diff --git a/src/azure-cli/azure/cli/command_modules/network/__init__.py b/src/azure-cli/azure/cli/command_modules/network/__init__.py index 2fe43ea8b52..d163ab420b6 100644 --- a/src/azure-cli/azure/cli/command_modules/network/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/network/__init__.py @@ -4,7 +4,6 @@ # -------------------------------------------------------------------------------------------- from azure.cli.core import AzCommandsLoader -from azure.cli.core.profiles import ResourceType import azure.cli.command_modules.network._help # pylint: disable=unused-import @@ -51,77 +50,4 @@ def load_arguments(self, command): load_arguments(self, command) -class AzureStackNetworkCommandsLoader(AzCommandsLoader): - - def __init__(self, cli_ctx=None): - from azure.cli.core import ModExtensionSuppress - from azure.cli.core.commands import CliCommandType - network_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.network.azure_stack.custom#{}') - super().__init__(cli_ctx=cli_ctx, - resource_type=ResourceType.MGMT_NETWORK, - custom_command_type=network_custom, - suppress_extension=[ - ModExtensionSuppress(__name__, 'dns', '0.0.2', - reason='These commands are now in the CLI.', - recommend_remove=True), - ModExtensionSuppress(__name__, 'express-route', '0.1.3', - reason='These commands are now in the CLI.', - recommend_remove=True) - ]) - - def load_command_table(self, args): - from azure.cli.core.aaz import load_aaz_command_table - from azure.cli.command_modules.network.azure_stack.commands import load_command_table - try: - from . import aaz - except ImportError: - aaz = None - - if aaz: - profile = self.cli_ctx.cloud.profile - try: - if profile.lower() == "2019-03-01-hybrid": - # use aaz in 2018-03-01-hybrid profile, because apis are the some. - self.cli_ctx.cloud.profile = "2018-03-01-hybrid" - load_aaz_command_table( - loader=self, - aaz_pkg_name=aaz.__name__, - args=args - ) - finally: - self.cli_ctx.cloud.profile = profile - - load_command_table(self, args) - - profile = self.get_module_by_profile("commands") - if profile and hasattr(profile, 'load_command_table'): - profile.load_command_table(self, args) - - return self.command_table - - def load_arguments(self, command): - from azure.cli.command_modules.network.azure_stack._params import load_arguments - load_arguments(self, command) - - profile = self.get_module_by_profile("_params") - if profile and hasattr(profile, 'load_arguments'): - profile.load_arguments(self, command) - - def get_module_name_by_profile(self, module_name): - from azure.cli.core.aaz.utils import get_aaz_profile_module_name - profile_module_name = get_aaz_profile_module_name(profile_name=self.cli_ctx.cloud.profile) - if module_name: - return f'azure.cli.command_modules.network.azure_stack.{profile_module_name}.{module_name}' - return f'azure.cli.command_modules.network.azure_stack.{profile_module_name}' - - def get_module_by_profile(self, name): - import importlib - module_name = self.get_module_name_by_profile(name) - return importlib.import_module(module_name) - - -def get_command_loader(cli_ctx): - if cli_ctx.cloud.profile.lower() != "latest": - return AzureStackNetworkCommandsLoader - - return NetworkCommandsLoader +COMMAND_LOADER_CLS = NetworkCommandsLoader diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/__init__.py deleted file mode 100644 index f6acc11aa4e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 - diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/__cmd_group.py deleted file mode 100644 index 5093d2928ba..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/__init__.py deleted file mode 100644 index 1ec185c184e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._list_usages import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/_list_usages.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/_list_usages.py deleted file mode 100644 index e7b2938c2a2..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/_list_usages.py +++ /dev/null @@ -1,182 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network list-usages", -) -class ListUsages(AAZCommand): - """List the number of network resources in a region that are used against a subscription quota. - - :example: List the provisioned network resources in East US region within a subscription. - az network list-usages --location eastus -o table - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/locations/{}/usages", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.UsagesList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class UsagesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "location", self.ctx.args.location, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.current_value = AAZIntType( - serialized_name="currentValue", - flags={"required": True}, - ) - _element.limit = AAZIntType( - flags={"required": True}, - ) - _element.name = AAZObjectType( - flags={"required": True}, - ) - _element.unit = AAZStrType( - flags={"required": True}, - ) - - name = cls._schema_on_200.value.Element.name - name.localized_value = AAZStrType( - serialized_name="localizedValue", - ) - name.value = AAZStrType() - - return cls._schema_on_200 - - -class _ListUsagesHelper: - """Helper class for ListUsages""" - - -__all__ = ["ListUsages"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/__cmd_group.py deleted file mode 100644 index 154e082d718..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb", -) -class __CMDGroup(AAZCommandGroup): - """Manage and configure load balancers. - - To learn more about Azure Load Balancer visit https://learn.microsoft.com/en-us/azure/load-balancer/quickstart-load-balancer-standard-public-cli. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_create.py deleted file mode 100644 index 8082f05e390..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_create.py +++ /dev/null @@ -1,2450 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Create(AAZCommand): - """Create a load balancer. - - :example: Create a basic load balancer. - az network lb create -g MyResourceGroup -n MyLb --sku Basic - - :example: Create a basic load balancer on a specific virtual network and subnet If a virtual network with the same name is found in the same resource group, the load balancer will utilize this virtual network. If one is not found a new one will be created. - az network lb create -g MyResourceGroup -n MyLb --sku Basic --vnet-name MyVnet --subnet MySubnet - - :example: Create a basic load balancer on a subnet of a pre-existing virtual network. The subnet can be in arbitary resource group or subscription by providing the ID of the subnet. - az network lb create -g MyResourceGroup -n MyLb --sku Basic --subnet {subnetID} - - :example: Create a basic zone flavored internal load balancer, through provisioning a zonal public ip. - az network lb create -g MyResourceGroup -n MyLb --sku Basic --public-ip-zone 2 - - :example: Create a standard zone flavored public-facing load balancer, through provisioning a zonal frontend ip configuration and Vnet. - az etwork lb create -g MyResourceGroup -n MyLb --sku Standard --frontend-ip-zone 1 --vnet-name MyVnet --subnet MySubnet - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - arg_group="Parameters", - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Parameters", - help="Resource tags.", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_address_pools = AAZListArg( - options=["--backend-address-pools"], - arg_group="Properties", - help="Collection of backend address pools used by a load balancer.", - ) - _args_schema.inbound_nat_pools = AAZListArg( - options=["--inbound-nat-pools"], - arg_group="Properties", - help="Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound NAT rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules.", - ) - _args_schema.inbound_nat_rules = AAZListArg( - options=["--inbound-nat-rules"], - arg_group="Properties", - help="Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules.", - ) - _args_schema.load_balancing_rules = AAZListArg( - options=["--load-balancing-rules"], - arg_group="Properties", - help="Object collection representing the load balancing rules Gets the provisioning.", - ) - _args_schema.outbound_nat_rules = AAZListArg( - options=["--outbound-nat-rules"], - arg_group="Properties", - help="The outbound NAT rules.", - ) - _args_schema.probes = AAZListArg( - options=["--probes"], - arg_group="Properties", - help="Collection of probe objects used in the load balancer.", - ) - - backend_address_pools = cls._args_schema.backend_address_pools - backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_schema.backend_address_pools.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resource.", - ) - - inbound_nat_pools = cls._args_schema.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectArg() - - _element = cls._args_schema.inbound_nat_pools.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource.", - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port_range_end = AAZIntArg( - options=["frontend-port-range-end"], - help="The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535.", - ) - _element.frontend_port_range_start = AAZIntArg( - options=["frontend-port-range-start"], - help="The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The reference to the transport protocol used by the inbound NAT pool.", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - - inbound_nat_rules = cls._args_schema.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_schema.inbound_nat_rules.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource.", - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The reference to the transport protocol used by the load balancing rule.", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - - load_balancing_rules = cls._args_schema.load_balancing_rules - load_balancing_rules.Element = AAZObjectArg() - - _element = cls._args_schema.load_balancing_rules.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of load balancing rules used by the load balancer. This name can be used to access the resource.", - ) - _element.backend_address_pool = AAZObjectArg( - options=["backend-address-pool"], - help="A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs.", - ) - cls._build_args_sub_resource_create(_element.backend_address_pool) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables \"Any Port\".", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["floating-ip", "enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables \"Any Port\".", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout", "idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.load_distribution = AAZStrArg( - options=["load-distribution"], - help="The load distribution policy for this rule.", - enum={"Default": "Default", "SourceIP": "SourceIP", "SourceIPProtocol": "SourceIPProtocol"}, - ) - _element.probe = AAZObjectArg( - options=["probe"], - help="The reference to the load balancer probe used by the load balancing rule.", - ) - cls._build_args_sub_resource_create(_element.probe) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The reference to the transport protocol used by the load balancing rule.", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - - outbound_nat_rules = cls._args_schema.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_schema.outbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.allocated_outbound_ports = AAZIntArg( - options=["allocated-outbound-ports"], - help="The number of outbound ports to be used for NAT.", - ) - _element.backend_address_pool = AAZObjectArg( - options=["backend-address-pool"], - help="A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs.", - ) - cls._build_args_sub_resource_create(_element.backend_address_pool) - _element.frontend_ip_configurations = AAZListArg( - options=["frontend-ip-configurations"], - help="The Frontend IP addresses of the load balancer.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - frontend_ip_configurations = cls._args_schema.outbound_nat_rules.Element.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectArg() - cls._build_args_sub_resource_create(frontend_ip_configurations.Element) - - probes = cls._args_schema.probes - probes.Element = AAZObjectArg() - - _element = cls._args_schema.probes.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of probes used by the load balancer. This name can be used to access the resource.", - ) - _element.interval_in_seconds = AAZIntArg( - options=["interval", "interval-in-seconds"], - help={"short-summary": "The interval, in seconds, for how frequently to probe the endpoint for health status.", "long-summary": "Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5."}, - ) - _element.number_of_probes = AAZIntArg( - options=["threshold", "number-of-probes"], - help={"short-summary": "The number of consecutive probe failures before an instance is deemed unhealthy.", "long-summary": "This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure."}, - ) - _element.port = AAZIntArg( - options=["port"], - help="The port for communicating the probe. Possible values range from 1 to 65535, inclusive.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help={"short-summary": "The protocol of the end point.", "long-summary": "If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful."}, - enum={"Http": "Http", "Tcp": "Tcp"}, - ) - _element.request_path = AAZStrArg( - options=["path", "request-path"], - help="The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed.", - ) - return cls._args_schema - - _args_backend_address_pool_create = None - - @classmethod - def _build_args_backend_address_pool_create(cls, _schema): - if cls._args_backend_address_pool_create is not None: - _schema.etag = cls._args_backend_address_pool_create.etag - _schema.id = cls._args_backend_address_pool_create.id - _schema.name = cls._args_backend_address_pool_create.name - _schema.provisioning_state = cls._args_backend_address_pool_create.provisioning_state - return - - cls._args_backend_address_pool_create = AAZObjectArg() - - backend_address_pool_create = cls._args_backend_address_pool_create - backend_address_pool_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - backend_address_pool_create.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - backend_address_pool_create.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - backend_address_pool_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - _schema.etag = cls._args_backend_address_pool_create.etag - _schema.id = cls._args_backend_address_pool_create.id - _schema.name = cls._args_backend_address_pool_create.name - _schema.provisioning_state = cls._args_backend_address_pool_create.provisioning_state - - _args_inbound_nat_rule_create = None - - @classmethod - def _build_args_inbound_nat_rule_create(cls, _schema): - if cls._args_inbound_nat_rule_create is not None: - _schema.backend_port = cls._args_inbound_nat_rule_create.backend_port - _schema.enable_floating_ip = cls._args_inbound_nat_rule_create.enable_floating_ip - _schema.etag = cls._args_inbound_nat_rule_create.etag - _schema.frontend_ip_configuration = cls._args_inbound_nat_rule_create.frontend_ip_configuration - _schema.frontend_port = cls._args_inbound_nat_rule_create.frontend_port - _schema.id = cls._args_inbound_nat_rule_create.id - _schema.idle_timeout_in_minutes = cls._args_inbound_nat_rule_create.idle_timeout_in_minutes - _schema.name = cls._args_inbound_nat_rule_create.name - _schema.protocol = cls._args_inbound_nat_rule_create.protocol - _schema.provisioning_state = cls._args_inbound_nat_rule_create.provisioning_state - return - - cls._args_inbound_nat_rule_create = AAZObjectArg() - - inbound_nat_rule_create = cls._args_inbound_nat_rule_create - inbound_nat_rule_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - inbound_nat_rule_create.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - inbound_nat_rule_create.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - inbound_nat_rule_create.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - inbound_nat_rule_create.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - inbound_nat_rule_create.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(inbound_nat_rule_create.frontend_ip_configuration) - inbound_nat_rule_create.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - inbound_nat_rule_create.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - inbound_nat_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - inbound_nat_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - _schema.backend_port = cls._args_inbound_nat_rule_create.backend_port - _schema.enable_floating_ip = cls._args_inbound_nat_rule_create.enable_floating_ip - _schema.etag = cls._args_inbound_nat_rule_create.etag - _schema.frontend_ip_configuration = cls._args_inbound_nat_rule_create.frontend_ip_configuration - _schema.frontend_port = cls._args_inbound_nat_rule_create.frontend_port - _schema.id = cls._args_inbound_nat_rule_create.id - _schema.idle_timeout_in_minutes = cls._args_inbound_nat_rule_create.idle_timeout_in_minutes - _schema.name = cls._args_inbound_nat_rule_create.name - _schema.protocol = cls._args_inbound_nat_rule_create.protocol - _schema.provisioning_state = cls._args_inbound_nat_rule_create.provisioning_state - - _args_network_security_group_create = None - - @classmethod - def _build_args_network_security_group_create(cls, _schema): - if cls._args_network_security_group_create is not None: - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.id = cls._args_network_security_group_create.id - _schema.location = cls._args_network_security_group_create.location - _schema.network_interfaces = cls._args_network_security_group_create.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_create.provisioning_state - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.subnets = cls._args_network_security_group_create.subnets - _schema.tags = cls._args_network_security_group_create.tags - return - - cls._args_network_security_group_create = AAZObjectArg() - - network_security_group_create = cls._args_network_security_group_create - network_security_group_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_create.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - network_security_group_create.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - ) - network_security_group_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - network_security_group_create.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - network_security_group_create.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group_create.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - network_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_network_security_group_create.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_create(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_create.network_interfaces - network_interfaces.Element = AAZObjectArg() - - _element = cls._args_network_security_group_create.network_interfaces.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - ) - _element.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - ) - _element.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - ) - _element.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - ) - _element.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_create(_element.network_security_group) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - ) - _element.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - ) - cls._build_args_sub_resource_create(_element.virtual_machine) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_network_security_group_create.network_interfaces.Element.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - ) - - applied_dns_servers = cls._args_network_security_group_create.network_interfaces.Element.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg() - - dns_servers = cls._args_network_security_group_create.network_interfaces.Element.dns_settings.dns_servers - dns_servers.Element = AAZStrArg() - - ip_configurations = cls._args_network_security_group_create.network_interfaces.Element.ip_configurations - ip_configurations.Element = AAZObjectArg() - - _element = cls._args_network_security_group_create.network_interfaces.Element.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - ) - _element.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - ) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - ) - _element.private_ip_address = AAZStrArg( - options=["private-ip-address"], - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address resource.", - ) - cls._build_args_public_ip_address_create(_element.public_ip_address) - _element.subnet = AAZObjectArg( - options=["subnet"], - ) - cls._build_args_subnet_create(_element.subnet) - - load_balancer_backend_address_pools = cls._args_network_security_group_create.network_interfaces.Element.ip_configurations.Element.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - cls._build_args_backend_address_pool_create(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = cls._args_network_security_group_create.network_interfaces.Element.ip_configurations.Element.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - cls._build_args_inbound_nat_rule_create(load_balancer_inbound_nat_rules.Element) - - tags = cls._args_network_security_group_create.network_interfaces.Element.tags - tags.Element = AAZStrArg() - - security_rules = cls._args_network_security_group_create.security_rules - security_rules.Element = AAZObjectArg() - - _element = cls._args_network_security_group_create.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - - subnets = cls._args_network_security_group_create.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_create(subnets.Element) - - tags = cls._args_network_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.id = cls._args_network_security_group_create.id - _schema.location = cls._args_network_security_group_create.location - _schema.network_interfaces = cls._args_network_security_group_create.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_create.provisioning_state - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.subnets = cls._args_network_security_group_create.subnets - _schema.tags = cls._args_network_security_group_create.tags - - _args_public_ip_address_create = None - - @classmethod - def _build_args_public_ip_address_create(cls, _schema): - if cls._args_public_ip_address_create is not None: - _schema.dns_settings = cls._args_public_ip_address_create.dns_settings - _schema.etag = cls._args_public_ip_address_create.etag - _schema.id = cls._args_public_ip_address_create.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_create.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_create.ip_address - _schema.location = cls._args_public_ip_address_create.location - _schema.provisioning_state = cls._args_public_ip_address_create.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_create.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_create.resource_guid - _schema.tags = cls._args_public_ip_address_create.tags - return - - cls._args_public_ip_address_create = AAZObjectArg() - - public_ip_address_create = cls._args_public_ip_address_create - public_ip_address_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - public_ip_address_create.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_create.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - ) - public_ip_address_create.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - ) - public_ip_address_create.ip_address = AAZStrArg( - options=["ip-address"], - ) - public_ip_address_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - public_ip_address_create.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_create.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - ) - public_ip_address_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_public_ip_address_create.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - ) - - tags = cls._args_public_ip_address_create.tags - tags.Element = AAZStrArg() - - _schema.dns_settings = cls._args_public_ip_address_create.dns_settings - _schema.etag = cls._args_public_ip_address_create.etag - _schema.id = cls._args_public_ip_address_create.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_create.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_create.ip_address - _schema.location = cls._args_public_ip_address_create.location - _schema.provisioning_state = cls._args_public_ip_address_create.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_create.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_create.resource_guid - _schema.tags = cls._args_public_ip_address_create.tags - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_port_range = cls._args_security_rule_create.source_port_range - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_port_range = cls._args_security_rule_create.source_port_range - - _args_sub_resource_create = None - - @classmethod - def _build_args_sub_resource_create(cls, _schema): - if cls._args_sub_resource_create is not None: - _schema.id = cls._args_sub_resource_create.id - return - - cls._args_sub_resource_create = AAZObjectArg() - - sub_resource_create = cls._args_sub_resource_create - sub_resource_create.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - - _schema.id = cls._args_sub_resource_create.id - - _args_subnet_create = None - - @classmethod - def _build_args_subnet_create(cls, _schema): - if cls._args_subnet_create is not None: - _schema.address_prefix = cls._args_subnet_create.address_prefix - _schema.etag = cls._args_subnet_create.etag - _schema.name = cls._args_subnet_create.name - _schema.network_security_group = cls._args_subnet_create.network_security_group - _schema.provisioning_state = cls._args_subnet_create.provisioning_state - _schema.route_table = cls._args_subnet_create.route_table - return - - cls._args_subnet_create = AAZObjectArg() - - subnet_create = cls._args_subnet_create - subnet_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - subnet_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - subnet_create.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - subnet_create.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_create(subnet_create.network_security_group) - subnet_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - ) - subnet_create.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - ) - - route_table = cls._args_subnet_create.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_subnet_create.route_table.routes - routes.Element = AAZObjectArg() - - _element = cls._args_subnet_create.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - subnets = cls._args_subnet_create.route_table.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_create(subnets.Element) - - tags = cls._args_subnet_create.route_table.tags - tags.Element = AAZStrArg() - - _schema.address_prefix = cls._args_subnet_create.address_prefix - _schema.etag = cls._args_subnet_create.etag - _schema.name = cls._args_subnet_create.name - _schema.network_security_group = cls._args_subnet_create.network_security_group - _schema.provisioning_state = cls._args_subnet_create.provisioning_state - _schema.route_table = cls._args_subnet_create.route_table - - def _execute_operations(self): - self.pre_operations() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendAddressPools", AAZListType, ".backend_address_pools") - properties.set_prop("inboundNatPools", AAZListType, ".inbound_nat_pools") - properties.set_prop("inboundNatRules", AAZListType, ".inbound_nat_rules") - properties.set_prop("loadBalancingRules", AAZListType, ".load_balancing_rules") - properties.set_prop("outboundNatRules", AAZListType, ".outbound_nat_rules") - properties.set_prop("probes", AAZListType, ".probes") - - backend_address_pools = _builder.get(".properties.backendAddressPools") - if backend_address_pools is not None: - backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.backendAddressPools[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - inbound_nat_pools = _builder.get(".properties.inboundNatPools") - if inbound_nat_pools is not None: - inbound_nat_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.inboundNatPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.inboundNatPools[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port", typ_kwargs={"flags": {"required": True}}) - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPortRangeEnd", AAZIntType, ".frontend_port_range_end", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("frontendPortRangeStart", AAZIntType, ".frontend_port_range_start", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - inbound_nat_rules = _builder.get(".properties.inboundNatRules") - if inbound_nat_rules is not None: - inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.inboundNatRules[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.inboundNatRules[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - - load_balancing_rules = _builder.get(".properties.loadBalancingRules") - if load_balancing_rules is not None: - load_balancing_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancingRules[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancingRules[].properties") - if properties is not None: - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("backendAddressPool", AAZObjectType, ".backend_address_pool")) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("loadDistribution", AAZStrType, ".load_distribution") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("probe", AAZObjectType, ".probe")) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - outbound_nat_rules = _builder.get(".properties.outboundNatRules") - if outbound_nat_rules is not None: - outbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.outboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.outboundNatRules[].properties") - if properties is not None: - properties.set_prop("allocatedOutboundPorts", AAZIntType, ".allocated_outbound_ports") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("backendAddressPool", AAZObjectType, ".backend_address_pool", typ_kwargs={"flags": {"required": True}})) - properties.set_prop("frontendIPConfigurations", AAZListType, ".frontend_ip_configurations") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - frontend_ip_configurations = _builder.get(".properties.outboundNatRules[].properties.frontendIPConfigurations") - if frontend_ip_configurations is not None: - _CreateHelper._build_schema_sub_resource_create(frontend_ip_configurations.set_elements(AAZObjectType, ".")) - - probes = _builder.get(".properties.probes") - if probes is not None: - probes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.probes[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.probes[].properties") - if properties is not None: - properties.set_prop("intervalInSeconds", AAZIntType, ".interval_in_seconds") - properties.set_prop("numberOfProbes", AAZIntType, ".number_of_probes") - properties.set_prop("port", AAZIntType, ".port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("requestPath", AAZStrType, ".request_path") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.location = AAZStrType() - _schema_on_200_201.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200_201.tags = AAZDictType() - _schema_on_200_201.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = cls._schema_on_200_201.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - _CreateHelper._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = cls._schema_on_200_201.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _CreateHelper._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _CreateHelper._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = cls._schema_on_200_201.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = cls._schema_on_200_201.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200_201.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = cls._schema_on_200_201.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = cls._schema_on_200_201.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _CreateHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = cls._schema_on_200_201.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _CreateHelper._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200_201.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - _CreateHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _CreateHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = cls._schema_on_200_201.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - _CreateHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = cls._schema_on_200_201.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = cls._schema_on_200_201.properties.probes - probes.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = cls._schema_on_200_201.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = cls._schema_on_200_201.tags - tags.Element = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_backend_address_pool_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_inbound_nat_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_network_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_create(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - network_interfaces.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkInterfaces[].properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - cls._build_schema_network_security_group_create(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_create(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.networkInterfaces[].properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_create(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_create(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - load_balancer_backend_address_pools = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[].properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - cls._build_schema_backend_address_pool_create(load_balancer_backend_address_pools.set_elements(AAZObjectType, ".")) - - load_balancer_inbound_nat_rules = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[].properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - cls._build_schema_inbound_nat_rule_create(load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkInterfaces[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_create(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - cls._build_schema_network_security_group_create(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_create(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_delete.py deleted file mode 100644 index c411f271e57..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb delete", -) -class Delete(AAZCommand): - """Delete the specified load balancer. - - :example: Delete a load balancer. - az network lb delete -g MyResourceGroup -n MyLb - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.LoadBalancersDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class LoadBalancersDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_list.py deleted file mode 100644 index 0d7d69e8c51..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_list.py +++ /dev/null @@ -1,1374 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb list", -) -class List(AAZCommand): - """List load balancers. - - :example: List load balancers. - az network lb list -g MyResourceGroup - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/loadbalancers", "2015-06-15"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.LoadBalancersList(ctx=self.ctx)() - if condition_1: - self.LoadBalancersListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class LoadBalancersList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = cls._schema_on_200.value.Element.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - _ListHelper._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = cls._schema_on_200.value.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _ListHelper._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _ListHelper._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = cls._schema_on_200.value.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ListHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = cls._schema_on_200.value.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _ListHelper._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - _ListHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ListHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = cls._schema_on_200.value.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - _ListHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = cls._schema_on_200.value.Element.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = cls._schema_on_200.value.Element.properties.probes - probes.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - class LoadBalancersListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = cls._schema_on_200.value.Element.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - _ListHelper._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = cls._schema_on_200.value.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _ListHelper._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _ListHelper._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = cls._schema_on_200.value.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ListHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = cls._schema_on_200.value.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _ListHelper._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - _ListHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ListHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = cls._schema_on_200.value.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - _ListHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = cls._schema_on_200.value.Element.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = cls._schema_on_200.value.Element.properties.probes - probes.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_show.py deleted file mode 100644 index be86a3623be..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_show.py +++ /dev/null @@ -1,1032 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb show", -) -class Show(AAZCommand): - """Get the details of a load balancer. - - :example: Get the details of a load balancer. - az network lb show -g MyResourceGroup -n MyLb - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = cls._schema_on_200.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - _ShowHelper._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = cls._schema_on_200.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _ShowHelper._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _ShowHelper._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = cls._schema_on_200.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ShowHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = cls._schema_on_200.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _ShowHelper._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - _ShowHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ShowHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = cls._schema_on_200.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - _ShowHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = cls._schema_on_200.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = cls._schema_on_200.properties.probes - probes.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = cls._schema_on_200.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_update.py deleted file mode 100644 index 575114a238a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_update.py +++ /dev/null @@ -1,2519 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb update", -) -class Update(AAZCommand): - """Update a load balancer. - - This command can only be used to update the tags for a load balancer. Name and resource group are immutable and cannot be updated. - - :example: Update the tags of a load balancer. - az network lb update -g MyResourceGroup -n MyLB --tags CostCenter=MyTestGroup - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.outbound_nat_rules = AAZListArg( - options=["--outbound-nat-rules"], - arg_group="Properties", - help="The outbound NAT rules.", - nullable=True, - ) - _args_schema.probes = AAZListArg( - options=["--probes"], - arg_group="Properties", - help="Collection of probe objects used in the load balancer.", - nullable=True, - ) - - outbound_nat_rules = cls._args_schema.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.outbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.allocated_outbound_ports = AAZIntArg( - options=["allocated-outbound-ports"], - help="The number of outbound ports to be used for NAT.", - nullable=True, - ) - _element.backend_address_pool = AAZObjectArg( - options=["backend-address-pool"], - help="A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.backend_address_pool) - _element.frontend_ip_configurations = AAZListArg( - options=["frontend-ip-configurations"], - help="The Frontend IP addresses of the load balancer.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - frontend_ip_configurations = cls._args_schema.outbound_nat_rules.Element.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_sub_resource_update(frontend_ip_configurations.Element) - - probes = cls._args_schema.probes - probes.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.probes.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of probes used by the load balancer. This name can be used to access the resource.", - nullable=True, - ) - _element.interval_in_seconds = AAZIntArg( - options=["interval", "interval-in-seconds"], - help={"short-summary": "The interval, in seconds, for how frequently to probe the endpoint for health status.", "long-summary": "Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5."}, - nullable=True, - ) - _element.number_of_probes = AAZIntArg( - options=["threshold", "number-of-probes"], - help={"short-summary": "The number of consecutive probe failures before an instance is deemed unhealthy.", "long-summary": "This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure."}, - nullable=True, - ) - _element.port = AAZIntArg( - options=["port"], - help="The port for communicating the probe. Possible values range from 1 to 65535, inclusive.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help={"short-summary": "The protocol of the end point.", "long-summary": "If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful."}, - enum={"Http": "Http", "Tcp": "Tcp"}, - ) - _element.request_path = AAZStrArg( - options=["path", "request-path"], - help="The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed.", - nullable=True, - ) - return cls._args_schema - - _args_backend_address_pool_update = None - - @classmethod - def _build_args_backend_address_pool_update(cls, _schema): - if cls._args_backend_address_pool_update is not None: - _schema.etag = cls._args_backend_address_pool_update.etag - _schema.id = cls._args_backend_address_pool_update.id - _schema.name = cls._args_backend_address_pool_update.name - _schema.provisioning_state = cls._args_backend_address_pool_update.provisioning_state - return - - cls._args_backend_address_pool_update = AAZObjectArg( - nullable=True, - ) - - backend_address_pool_update = cls._args_backend_address_pool_update - backend_address_pool_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - backend_address_pool_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - backend_address_pool_update.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - backend_address_pool_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - _schema.etag = cls._args_backend_address_pool_update.etag - _schema.id = cls._args_backend_address_pool_update.id - _schema.name = cls._args_backend_address_pool_update.name - _schema.provisioning_state = cls._args_backend_address_pool_update.provisioning_state - - _args_inbound_nat_rule_update = None - - @classmethod - def _build_args_inbound_nat_rule_update(cls, _schema): - if cls._args_inbound_nat_rule_update is not None: - _schema.backend_port = cls._args_inbound_nat_rule_update.backend_port - _schema.enable_floating_ip = cls._args_inbound_nat_rule_update.enable_floating_ip - _schema.etag = cls._args_inbound_nat_rule_update.etag - _schema.frontend_ip_configuration = cls._args_inbound_nat_rule_update.frontend_ip_configuration - _schema.frontend_port = cls._args_inbound_nat_rule_update.frontend_port - _schema.id = cls._args_inbound_nat_rule_update.id - _schema.idle_timeout_in_minutes = cls._args_inbound_nat_rule_update.idle_timeout_in_minutes - _schema.name = cls._args_inbound_nat_rule_update.name - _schema.protocol = cls._args_inbound_nat_rule_update.protocol - _schema.provisioning_state = cls._args_inbound_nat_rule_update.provisioning_state - return - - cls._args_inbound_nat_rule_update = AAZObjectArg( - nullable=True, - ) - - inbound_nat_rule_update = cls._args_inbound_nat_rule_update - inbound_nat_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - inbound_nat_rule_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - inbound_nat_rule_update.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - inbound_nat_rule_update.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - nullable=True, - ) - inbound_nat_rule_update.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - inbound_nat_rule_update.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - nullable=True, - ) - cls._build_args_sub_resource_update(inbound_nat_rule_update.frontend_ip_configuration) - inbound_nat_rule_update.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - nullable=True, - ) - inbound_nat_rule_update.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - inbound_nat_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - nullable=True, - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - inbound_nat_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - _schema.backend_port = cls._args_inbound_nat_rule_update.backend_port - _schema.enable_floating_ip = cls._args_inbound_nat_rule_update.enable_floating_ip - _schema.etag = cls._args_inbound_nat_rule_update.etag - _schema.frontend_ip_configuration = cls._args_inbound_nat_rule_update.frontend_ip_configuration - _schema.frontend_port = cls._args_inbound_nat_rule_update.frontend_port - _schema.id = cls._args_inbound_nat_rule_update.id - _schema.idle_timeout_in_minutes = cls._args_inbound_nat_rule_update.idle_timeout_in_minutes - _schema.name = cls._args_inbound_nat_rule_update.name - _schema.protocol = cls._args_inbound_nat_rule_update.protocol - _schema.provisioning_state = cls._args_inbound_nat_rule_update.provisioning_state - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg( - nullable=True, - ) - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - network_security_group_update.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - nullable=True, - ) - network_security_group_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - network_security_group_update.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_update.network_interfaces - network_interfaces.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.network_interfaces.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - nullable=True, - ) - _element.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - nullable=True, - ) - _element.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - nullable=True, - ) - _element.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - nullable=True, - ) - _element.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(_element.network_security_group) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - nullable=True, - ) - _element.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.virtual_machine) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_network_security_group_update.network_interfaces.Element.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - nullable=True, - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - nullable=True, - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - nullable=True, - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - nullable=True, - ) - - applied_dns_servers = cls._args_network_security_group_update.network_interfaces.Element.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg( - nullable=True, - ) - - dns_servers = cls._args_network_security_group_update.network_interfaces.Element.dns_settings.dns_servers - dns_servers.Element = AAZStrArg( - nullable=True, - ) - - ip_configurations = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - nullable=True, - ) - _element.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - nullable=True, - ) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - nullable=True, - ) - _element.private_ip_address = AAZStrArg( - options=["private-ip-address"], - nullable=True, - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - nullable=True, - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address resource.", - nullable=True, - ) - cls._build_args_public_ip_address_update(_element.public_ip_address) - _element.subnet = AAZObjectArg( - options=["subnet"], - nullable=True, - ) - cls._build_args_subnet_update(_element.subnet) - - load_balancer_backend_address_pools = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations.Element.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_backend_address_pool_update(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations.Element.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_inbound_nat_rule_update(load_balancer_inbound_nat_rules.Element) - - tags = cls._args_network_security_group_update.network_interfaces.Element.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - - subnets = cls._args_network_security_group_update.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - - _args_public_ip_address_update = None - - @classmethod - def _build_args_public_ip_address_update(cls, _schema): - if cls._args_public_ip_address_update is not None: - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.id = cls._args_public_ip_address_update.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.tags = cls._args_public_ip_address_update.tags - return - - cls._args_public_ip_address_update = AAZObjectArg( - nullable=True, - ) - - public_ip_address_update = cls._args_public_ip_address_update - public_ip_address_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - public_ip_address_update.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_update.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - nullable=True, - ) - public_ip_address_update.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - nullable=True, - ) - public_ip_address_update.ip_address = AAZStrArg( - options=["ip-address"], - nullable=True, - ) - public_ip_address_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - public_ip_address_update.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - nullable=True, - ) - public_ip_address_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_public_ip_address_update.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - nullable=True, - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - nullable=True, - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - nullable=True, - ) - - tags = cls._args_public_ip_address_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.id = cls._args_public_ip_address_update.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.tags = cls._args_public_ip_address_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_subnet_update = None - - @classmethod - def _build_args_subnet_update(cls, _schema): - if cls._args_subnet_update is not None: - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - return - - cls._args_subnet_update = AAZObjectArg( - nullable=True, - ) - - subnet_update = cls._args_subnet_update - subnet_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - subnet_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - subnet_update.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - nullable=True, - ) - subnet_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(subnet_update.network_security_group) - subnet_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - nullable=True, - ) - subnet_update.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - nullable=True, - ) - - route_table = cls._args_subnet_update.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - nullable=True, - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - routes = cls._args_subnet_update.route_table.routes - routes.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - nullable=True, - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - nullable=True, - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - subnets = cls._args_subnet_update.route_table.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_subnet_update.route_table.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("outboundNatRules", AAZListType, ".outbound_nat_rules") - properties.set_prop("probes", AAZListType, ".probes") - - outbound_nat_rules = _builder.get(".properties.outboundNatRules") - if outbound_nat_rules is not None: - outbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.outboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.outboundNatRules[].properties") - if properties is not None: - properties.set_prop("allocatedOutboundPorts", AAZIntType, ".allocated_outbound_ports") - _UpdateHelper._build_schema_sub_resource_update(properties.set_prop("backendAddressPool", AAZObjectType, ".backend_address_pool", typ_kwargs={"flags": {"required": True}})) - properties.set_prop("frontendIPConfigurations", AAZListType, ".frontend_ip_configurations") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - frontend_ip_configurations = _builder.get(".properties.outboundNatRules[].properties.frontendIPConfigurations") - if frontend_ip_configurations is not None: - _UpdateHelper._build_schema_sub_resource_update(frontend_ip_configurations.set_elements(AAZObjectType, ".")) - - probes = _builder.get(".properties.probes") - if probes is not None: - probes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.probes[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.probes[].properties") - if properties is not None: - properties.set_prop("intervalInSeconds", AAZIntType, ".interval_in_seconds") - properties.set_prop("numberOfProbes", AAZIntType, ".number_of_probes") - properties.set_prop("port", AAZIntType, ".port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("requestPath", AAZStrType, ".request_path") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_backend_address_pool_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_inbound_nat_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_update(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - network_interfaces.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkInterfaces[].properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_update(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.networkInterfaces[].properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - load_balancer_backend_address_pools = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[].properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - cls._build_schema_backend_address_pool_update(load_balancer_backend_address_pools.set_elements(AAZObjectType, ".")) - - load_balancer_inbound_nat_rules = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[].properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - cls._build_schema_inbound_nat_rule_update(load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkInterfaces[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_wait.py deleted file mode 100644 index 6c8603d741b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/_wait.py +++ /dev/null @@ -1,1028 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = cls._schema_on_200.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - _WaitHelper._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = cls._schema_on_200.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _WaitHelper._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _WaitHelper._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = cls._schema_on_200.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _WaitHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = cls._schema_on_200.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _WaitHelper._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - _WaitHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _WaitHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = cls._schema_on_200.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - _WaitHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = cls._schema_on_200.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = cls._schema_on_200.properties.probes - probes.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = cls._schema_on_200.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/__cmd_group.py deleted file mode 100644 index cf0d53eb3e1..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb address-pool", -) -class __CMDGroup(AAZCommandGroup): - """Manage address pools of a load balancer. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/__init__.py deleted file mode 100644 index 2d1a2078686..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/_create.py deleted file mode 100644 index cc6adabbdbb..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/_create.py +++ /dev/null @@ -1,1223 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb address-pool create", -) -class Create(AAZCommand): - """Create an address pool. - - :example: Create an address pool. - az network lb address-pool create -g MyResourceGroup --lb-name MyLb -n MyAddressPool - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.backendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.address_pool_name = AAZStrArg( - options=["-n", "--name", "--address-pool-name"], - help="The name of the backend address pool.", - required=True, - ) - - # define Arg Group "Parameters.properties.backendAddressPools[]" - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".address_pool_name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/_delete.py deleted file mode 100644 index 6a49b66d71b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/_delete.py +++ /dev/null @@ -1,1205 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb address-pool delete", -) -class Delete(AAZCommand): - """Delete an address pool. - - :example: Delete an address pool. - az network lb address-pool delete -g MyResourceGroup --lb-name MyLb -n MyAddressPool - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.backendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.address_pool_name = AAZStrArg( - options=["-n", "--name", "--address-pool-name"], - help="The name of the backend address pool.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/_list.py deleted file mode 100644 index f5b8c2eddd0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/_list.py +++ /dev/null @@ -1,1061 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb address-pool list", -) -class List(AAZCommand): - """List address pools. - - :example: List address pools. - az network lb address-pool list -g MyResourceGroup --lb-name MyLb - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.backendAddressPools"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.backendAddressPools - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.backendAddressPools = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/_show.py deleted file mode 100644 index 58cc86b8e02..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/_show.py +++ /dev/null @@ -1,1080 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb address-pool show", -) -class Show(AAZCommand): - """Get the details of an address pool. - - :example: Get the details of an address pool. - az network lb address-pool show -g MyResourceGroup --lb-name MyLb -n MyAddressPool - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.backendAddressPools[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.address_pool_name = AAZStrArg( - options=["-n", "--name", "--address-pool-name"], - help="The name of the backend address pool.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/_wait.py deleted file mode 100644 index 94ddc01c0f8..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/address_pool/_wait.py +++ /dev/null @@ -1,1046 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb address-pool wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.backendAddressPools[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/__cmd_group.py deleted file mode 100644 index 80debcfe9ee..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb frontend-ip", -) -class __CMDGroup(AAZCommandGroup): - """Manage frontend IP addresses of a load balancer. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_create.py deleted file mode 100644 index 04a7f9725b4..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_create.py +++ /dev/null @@ -1,2289 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip create", -) -class Create(AAZCommand): - """Create a frontend IP address. - - :example: Create a frontend ip address for a public load balancer. - az network lb frontend-ip create -g MyResourceGroup -n MyFrontendIp --lb-name MyLb --public-ip-address MyFrontendIp - - :example: Create a frontend ip address for an internal load balancer. - az network lb frontend-ip create -g MyResourceGroup -n MyFrontendIp --lb-name MyLb --private-ip-address 10.10.10.100 --subnet MySubnet --vnet-name MyVnet - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.frontendIPConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the frontend IP configuration.", - required=True, - ) - - # define Arg Group "Parameters.properties.frontendIPConfigurations[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="Properties", - help="Static private IP address to associate with the configuration.", - ) - _args_schema.private_ip_allocation_method = AAZStrArg( - options=["--private-ip-allocation-method"], - arg_group="Properties", - help="The Private IP allocation method.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="Properties", - help="Name or ID of the existing public IP to associate with the configuration.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - _args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="Properties", - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualnetworks/{}/subnets/{}", - ), - ) - - # define Arg Group "PublicIpAddress" - - # define Arg Group "Subnet" - - # define Arg Group "Subnets" - return cls._args_schema - - _args_backend_address_pool_update = None - - @classmethod - def _build_args_backend_address_pool_update(cls, _schema): - if cls._args_backend_address_pool_update is not None: - _schema.etag = cls._args_backend_address_pool_update.etag - _schema.id = cls._args_backend_address_pool_update.id - _schema.name = cls._args_backend_address_pool_update.name - _schema.provisioning_state = cls._args_backend_address_pool_update.provisioning_state - return - - cls._args_backend_address_pool_update = AAZObjectArg() - - backend_address_pool_update = cls._args_backend_address_pool_update - backend_address_pool_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - backend_address_pool_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - backend_address_pool_update.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - backend_address_pool_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - _schema.etag = cls._args_backend_address_pool_update.etag - _schema.id = cls._args_backend_address_pool_update.id - _schema.name = cls._args_backend_address_pool_update.name - _schema.provisioning_state = cls._args_backend_address_pool_update.provisioning_state - - _args_inbound_nat_rule_update = None - - @classmethod - def _build_args_inbound_nat_rule_update(cls, _schema): - if cls._args_inbound_nat_rule_update is not None: - _schema.backend_port = cls._args_inbound_nat_rule_update.backend_port - _schema.enable_floating_ip = cls._args_inbound_nat_rule_update.enable_floating_ip - _schema.etag = cls._args_inbound_nat_rule_update.etag - _schema.frontend_ip_configuration = cls._args_inbound_nat_rule_update.frontend_ip_configuration - _schema.frontend_port = cls._args_inbound_nat_rule_update.frontend_port - _schema.id = cls._args_inbound_nat_rule_update.id - _schema.idle_timeout_in_minutes = cls._args_inbound_nat_rule_update.idle_timeout_in_minutes - _schema.name = cls._args_inbound_nat_rule_update.name - _schema.protocol = cls._args_inbound_nat_rule_update.protocol - _schema.provisioning_state = cls._args_inbound_nat_rule_update.provisioning_state - return - - cls._args_inbound_nat_rule_update = AAZObjectArg() - - inbound_nat_rule_update = cls._args_inbound_nat_rule_update - inbound_nat_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - inbound_nat_rule_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - inbound_nat_rule_update.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - inbound_nat_rule_update.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - inbound_nat_rule_update.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - inbound_nat_rule_update.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_update(inbound_nat_rule_update.frontend_ip_configuration) - inbound_nat_rule_update.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - inbound_nat_rule_update.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - inbound_nat_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - inbound_nat_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - _schema.backend_port = cls._args_inbound_nat_rule_update.backend_port - _schema.enable_floating_ip = cls._args_inbound_nat_rule_update.enable_floating_ip - _schema.etag = cls._args_inbound_nat_rule_update.etag - _schema.frontend_ip_configuration = cls._args_inbound_nat_rule_update.frontend_ip_configuration - _schema.frontend_port = cls._args_inbound_nat_rule_update.frontend_port - _schema.id = cls._args_inbound_nat_rule_update.id - _schema.idle_timeout_in_minutes = cls._args_inbound_nat_rule_update.idle_timeout_in_minutes - _schema.name = cls._args_inbound_nat_rule_update.name - _schema.protocol = cls._args_inbound_nat_rule_update.protocol - _schema.provisioning_state = cls._args_inbound_nat_rule_update.provisioning_state - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg() - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - network_security_group_update.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - ) - network_security_group_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group_update.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_update(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_update.network_interfaces - network_interfaces.Element = AAZObjectArg() - - _element = cls._args_network_security_group_update.network_interfaces.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - ) - _element.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - ) - _element.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - ) - _element.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - ) - _element.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_update(_element.network_security_group) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - ) - _element.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - ) - cls._build_args_sub_resource_update(_element.virtual_machine) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_network_security_group_update.network_interfaces.Element.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - ) - - applied_dns_servers = cls._args_network_security_group_update.network_interfaces.Element.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg() - - dns_servers = cls._args_network_security_group_update.network_interfaces.Element.dns_settings.dns_servers - dns_servers.Element = AAZStrArg() - - ip_configurations = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations - ip_configurations.Element = AAZObjectArg() - - _element = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - ) - _element.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - ) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - ) - _element.private_ip_address = AAZStrArg( - options=["private-ip-address"], - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address resource.", - ) - cls._build_args_public_ip_address_update(_element.public_ip_address) - _element.subnet = AAZObjectArg( - options=["subnet"], - ) - cls._build_args_subnet_update(_element.subnet) - - load_balancer_backend_address_pools = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations.Element.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - cls._build_args_backend_address_pool_update(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations.Element.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - cls._build_args_inbound_nat_rule_update(load_balancer_inbound_nat_rules.Element) - - tags = cls._args_network_security_group_update.network_interfaces.Element.tags - tags.Element = AAZStrArg() - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg() - - _element = cls._args_network_security_group_update.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - - subnets = cls._args_network_security_group_update.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg() - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - - _args_public_ip_address_update = None - - @classmethod - def _build_args_public_ip_address_update(cls, _schema): - if cls._args_public_ip_address_update is not None: - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.id = cls._args_public_ip_address_update.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.tags = cls._args_public_ip_address_update.tags - return - - cls._args_public_ip_address_update = AAZObjectArg() - - public_ip_address_update = cls._args_public_ip_address_update - public_ip_address_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - public_ip_address_update.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_update.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - ) - public_ip_address_update.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - ) - public_ip_address_update.ip_address = AAZStrArg( - options=["ip-address"], - ) - public_ip_address_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - public_ip_address_update.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - ) - public_ip_address_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_public_ip_address_update.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - ) - - tags = cls._args_public_ip_address_update.tags - tags.Element = AAZStrArg() - - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.id = cls._args_public_ip_address_update.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.tags = cls._args_public_ip_address_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - return - - cls._args_security_rule_update = AAZObjectArg() - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg() - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_subnet_update = None - - @classmethod - def _build_args_subnet_update(cls, _schema): - if cls._args_subnet_update is not None: - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - return - - cls._args_subnet_update = AAZObjectArg() - - subnet_update = cls._args_subnet_update - subnet_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - subnet_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - subnet_update.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - subnet_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_update(subnet_update.network_security_group) - subnet_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - ) - subnet_update.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - ) - - route_table = cls._args_subnet_update.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_subnet_update.route_table.routes - routes.Element = AAZObjectArg() - - _element = cls._args_subnet_update.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - subnets = cls._args_subnet_update.route_table.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_subnet_update.route_table.tags - tags.Element = AAZStrArg() - - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType) - properties.set_prop("subnet", AAZObjectType) - - public_ip_address = _builder.get(".properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".public_ip_address") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - subnet = _builder.get(".properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_backend_address_pool_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_inbound_nat_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_update(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - network_interfaces.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkInterfaces[].properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_update(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.networkInterfaces[].properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - load_balancer_backend_address_pools = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[].properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - cls._build_schema_backend_address_pool_update(load_balancer_backend_address_pools.set_elements(AAZObjectType, ".")) - - load_balancer_inbound_nat_rules = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[].properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - cls._build_schema_inbound_nat_rule_update(load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkInterfaces[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_delete.py deleted file mode 100644 index e83839e44df..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_delete.py +++ /dev/null @@ -1,1205 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip delete", -) -class Delete(AAZCommand): - """Delete a frontend IP address. - - :example: Delete a frontend IP address. - az network lb frontend-ip delete -g MyResourceGroup --lb-name MyLb -n MyFrontendIp - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.frontendIPConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the frontend IP configuration.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_list.py deleted file mode 100644 index aeec9893185..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_list.py +++ /dev/null @@ -1,1061 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip list", -) -class List(AAZCommand): - """List frontend IP addresses. - - :example: List frontend IP addresses. - az network lb frontend-ip list -g MyResourceGroup --lb-name MyLb - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.frontendIPConfigurations"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.frontendIPConfigurations - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.frontendIPConfigurations = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_show.py deleted file mode 100644 index 37ad5c2f9f2..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_show.py +++ /dev/null @@ -1,1080 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip show", -) -class Show(AAZCommand): - """Get the details of a frontend IP address. - - :example: Get the details of a frontend IP address. - az network lb frontend-ip show -g MyResourceGroup --lb-name MyLb -n MyFrontendIp - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.frontendIPConfigurations[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the frontend IP configuration.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_update.py deleted file mode 100644 index b150e3c2c55..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_update.py +++ /dev/null @@ -1,2449 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip update", -) -class Update(AAZCommand): - """Update a frontend IP address. - - :example: Update the frontend IP address of a public load balancer. - az network lb frontend-ip update -g MyResourceGroup --lb-name MyLb -n MyFrontendIp --public-ip-address MyNewPublicIp - - :example: Update the frontend IP address of an internal load balancer. - az network lb frontend-ip update -g MyResourceGroup --lb-name MyLb -n MyFrontendIp --private-ip-address 10.10.10.50 - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.frontendIPConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the frontend IP configuration.", - required=True, - ) - - # define Arg Group "Parameters.properties.frontendIPConfigurations[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="Properties", - help="Static private IP address to associate with the configuration.", - nullable=True, - ) - _args_schema.private_ip_allocation_method = AAZStrArg( - options=["--private-ip-allocation-method"], - arg_group="Properties", - help="The Private IP allocation method.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="Properties", - help="Name or ID of the existing public IP to associate with the configuration.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - _args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="Properties", - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualnetworks/{}/subnets/{}", - ), - ) - - # define Arg Group "PublicIpAddress" - - # define Arg Group "Subnet" - - # define Arg Group "Subnets" - return cls._args_schema - - _args_backend_address_pool_update = None - - @classmethod - def _build_args_backend_address_pool_update(cls, _schema): - if cls._args_backend_address_pool_update is not None: - _schema.etag = cls._args_backend_address_pool_update.etag - _schema.id = cls._args_backend_address_pool_update.id - _schema.name = cls._args_backend_address_pool_update.name - _schema.provisioning_state = cls._args_backend_address_pool_update.provisioning_state - return - - cls._args_backend_address_pool_update = AAZObjectArg( - nullable=True, - ) - - backend_address_pool_update = cls._args_backend_address_pool_update - backend_address_pool_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - backend_address_pool_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - backend_address_pool_update.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - backend_address_pool_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - _schema.etag = cls._args_backend_address_pool_update.etag - _schema.id = cls._args_backend_address_pool_update.id - _schema.name = cls._args_backend_address_pool_update.name - _schema.provisioning_state = cls._args_backend_address_pool_update.provisioning_state - - _args_inbound_nat_rule_update = None - - @classmethod - def _build_args_inbound_nat_rule_update(cls, _schema): - if cls._args_inbound_nat_rule_update is not None: - _schema.backend_port = cls._args_inbound_nat_rule_update.backend_port - _schema.enable_floating_ip = cls._args_inbound_nat_rule_update.enable_floating_ip - _schema.etag = cls._args_inbound_nat_rule_update.etag - _schema.frontend_ip_configuration = cls._args_inbound_nat_rule_update.frontend_ip_configuration - _schema.frontend_port = cls._args_inbound_nat_rule_update.frontend_port - _schema.id = cls._args_inbound_nat_rule_update.id - _schema.idle_timeout_in_minutes = cls._args_inbound_nat_rule_update.idle_timeout_in_minutes - _schema.name = cls._args_inbound_nat_rule_update.name - _schema.protocol = cls._args_inbound_nat_rule_update.protocol - _schema.provisioning_state = cls._args_inbound_nat_rule_update.provisioning_state - return - - cls._args_inbound_nat_rule_update = AAZObjectArg( - nullable=True, - ) - - inbound_nat_rule_update = cls._args_inbound_nat_rule_update - inbound_nat_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - inbound_nat_rule_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - inbound_nat_rule_update.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - inbound_nat_rule_update.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - nullable=True, - ) - inbound_nat_rule_update.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - inbound_nat_rule_update.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - nullable=True, - ) - cls._build_args_sub_resource_update(inbound_nat_rule_update.frontend_ip_configuration) - inbound_nat_rule_update.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - nullable=True, - ) - inbound_nat_rule_update.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - inbound_nat_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - nullable=True, - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - inbound_nat_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - _schema.backend_port = cls._args_inbound_nat_rule_update.backend_port - _schema.enable_floating_ip = cls._args_inbound_nat_rule_update.enable_floating_ip - _schema.etag = cls._args_inbound_nat_rule_update.etag - _schema.frontend_ip_configuration = cls._args_inbound_nat_rule_update.frontend_ip_configuration - _schema.frontend_port = cls._args_inbound_nat_rule_update.frontend_port - _schema.id = cls._args_inbound_nat_rule_update.id - _schema.idle_timeout_in_minutes = cls._args_inbound_nat_rule_update.idle_timeout_in_minutes - _schema.name = cls._args_inbound_nat_rule_update.name - _schema.protocol = cls._args_inbound_nat_rule_update.protocol - _schema.provisioning_state = cls._args_inbound_nat_rule_update.provisioning_state - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg( - nullable=True, - ) - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - network_security_group_update.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - nullable=True, - ) - network_security_group_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - network_security_group_update.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_update.network_interfaces - network_interfaces.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.network_interfaces.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - nullable=True, - ) - _element.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - nullable=True, - ) - _element.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - nullable=True, - ) - _element.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - nullable=True, - ) - _element.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(_element.network_security_group) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - nullable=True, - ) - _element.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.virtual_machine) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_network_security_group_update.network_interfaces.Element.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - nullable=True, - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - nullable=True, - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - nullable=True, - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - nullable=True, - ) - - applied_dns_servers = cls._args_network_security_group_update.network_interfaces.Element.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg( - nullable=True, - ) - - dns_servers = cls._args_network_security_group_update.network_interfaces.Element.dns_settings.dns_servers - dns_servers.Element = AAZStrArg( - nullable=True, - ) - - ip_configurations = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - nullable=True, - ) - _element.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - nullable=True, - ) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - nullable=True, - ) - _element.private_ip_address = AAZStrArg( - options=["private-ip-address"], - nullable=True, - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - nullable=True, - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address resource.", - nullable=True, - ) - cls._build_args_public_ip_address_update(_element.public_ip_address) - _element.subnet = AAZObjectArg( - options=["subnet"], - nullable=True, - ) - cls._build_args_subnet_update(_element.subnet) - - load_balancer_backend_address_pools = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations.Element.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_backend_address_pool_update(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations.Element.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_inbound_nat_rule_update(load_balancer_inbound_nat_rules.Element) - - tags = cls._args_network_security_group_update.network_interfaces.Element.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - - subnets = cls._args_network_security_group_update.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - - _args_public_ip_address_update = None - - @classmethod - def _build_args_public_ip_address_update(cls, _schema): - if cls._args_public_ip_address_update is not None: - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.id = cls._args_public_ip_address_update.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.tags = cls._args_public_ip_address_update.tags - return - - cls._args_public_ip_address_update = AAZObjectArg( - nullable=True, - ) - - public_ip_address_update = cls._args_public_ip_address_update - public_ip_address_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - public_ip_address_update.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_update.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - nullable=True, - ) - public_ip_address_update.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - nullable=True, - ) - public_ip_address_update.ip_address = AAZStrArg( - options=["ip-address"], - nullable=True, - ) - public_ip_address_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - public_ip_address_update.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - nullable=True, - ) - public_ip_address_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_public_ip_address_update.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - nullable=True, - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - nullable=True, - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - nullable=True, - ) - - tags = cls._args_public_ip_address_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.id = cls._args_public_ip_address_update.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.tags = cls._args_public_ip_address_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_subnet_update = None - - @classmethod - def _build_args_subnet_update(cls, _schema): - if cls._args_subnet_update is not None: - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - return - - cls._args_subnet_update = AAZObjectArg( - nullable=True, - ) - - subnet_update = cls._args_subnet_update - subnet_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - subnet_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - subnet_update.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - nullable=True, - ) - subnet_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(subnet_update.network_security_group) - subnet_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - nullable=True, - ) - subnet_update.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - nullable=True, - ) - - route_table = cls._args_subnet_update.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - nullable=True, - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - routes = cls._args_subnet_update.route_table.routes - routes.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - nullable=True, - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - nullable=True, - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - subnets = cls._args_subnet_update.route_table.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_subnet_update.route_table.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType) - properties.set_prop("subnet", AAZObjectType) - - public_ip_address = _builder.get(".properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".public_ip_address") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - subnet = _builder.get(".properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_backend_address_pool_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_inbound_nat_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_update(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - network_interfaces.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkInterfaces[].properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_update(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.networkInterfaces[].properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - load_balancer_backend_address_pools = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[].properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - cls._build_schema_backend_address_pool_update(load_balancer_backend_address_pools.set_elements(AAZObjectType, ".")) - - load_balancer_inbound_nat_rules = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations[].properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - cls._build_schema_inbound_nat_rule_update(load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkInterfaces[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_wait.py deleted file mode 100644 index ca6690fe6c2..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/frontend_ip/_wait.py +++ /dev/null @@ -1,1046 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.frontendIPConfigurations[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/__cmd_group.py deleted file mode 100644 index 8c9b57a8e8a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb inbound-nat-pool", -) -class __CMDGroup(AAZCommandGroup): - """Manage inbound NAT address pools of a load balancer. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_create.py deleted file mode 100644 index 7a6b25dab39..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_create.py +++ /dev/null @@ -1,1263 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool create", -) -class Create(AAZCommand): - """Create an inbound NAT address pool. - - :example: Create an inbound NAT address pool. - az network lb inbound-nat-pool create -g MyResourceGroup --lb-name MyLb -n MyNatPool --protocol Tcp --frontend-port-range-start 80 --frontend-port-range-end 89 --backend-port 80 --frontend-ip MyFrontendIp - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.inboundNatPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource.", - required=True, - ) - - # define Arg Group "Parameters.properties.inboundNatPools[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535.", - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name or ID of the frontend IP configuration.", - ) - _args_schema.frontend_port_range_end = AAZIntArg( - options=["--frontend-port-range-end"], - arg_group="Properties", - help="The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535.", - ) - _args_schema.frontend_port_range_start = AAZIntArg( - options=["--frontend-port-range-start"], - arg_group="Properties", - help="The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the inbound NAT pool.", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPortRangeEnd", AAZIntType, ".frontend_port_range_end", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("frontendPortRangeStart", AAZIntType, ".frontend_port_range_start", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_delete.py deleted file mode 100644 index 67c3858573e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_delete.py +++ /dev/null @@ -1,1205 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool delete", -) -class Delete(AAZCommand): - """Delete an inbound NAT address pool. - - :example: Delete an inbound NAT address pool. - az network lb inbound-nat-pool delete -g MyResourceGroup --lb-name MyLb -n MyNatPool - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.inboundNatPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_list.py deleted file mode 100644 index 97ac5eb1c98..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_list.py +++ /dev/null @@ -1,1061 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool list", -) -class List(AAZCommand): - """List inbound NAT address pools. - - :example: List inbound NAT address pools. - az network lb inbound-nat-pool list -g MyResourceGroup --lb-name MyLb - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.inboundNatPools"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.inboundNatPools - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.inboundNatPools = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_show.py deleted file mode 100644 index 0ec47f36580..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_show.py +++ /dev/null @@ -1,1080 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool show", -) -class Show(AAZCommand): - """Get the details of an inbound NAT address pool. - - :example: Get the details of an inbound NAT address pool. - az network lb inbound-nat-pool show -g MyResourceGroup --lb-name MyLb -n MyNatPool - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.inboundNatPools[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_update.py deleted file mode 100644 index 548a3880d42..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_update.py +++ /dev/null @@ -1,1279 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool update", -) -class Update(AAZCommand): - """Update an inbound NAT address pool. - - :example: Update an inbound NAT address pool to a different backend port. - az network lb inbound-nat-pool update -g MyResourceGroup --lb-name MyLb -n MyNatPool --protocol Tcp --backend-port 8080 - - :example: Update an inbound NAT address pool. - az network lb inbound-nat-pool update --backend-port 8080 --enable-tcp-reset true --frontend-port-range-end 89 --frontend-port-range-start 80 --lb-name MyLb --name MyNatPool --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.inboundNatPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource.", - required=True, - ) - - # define Arg Group "Parameters.properties.inboundNatPools[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535.", - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name or ID of the frontend IP configuration.", - nullable=True, - ) - _args_schema.frontend_port_range_end = AAZIntArg( - options=["--frontend-port-range-end"], - arg_group="Properties", - help="The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535.", - ) - _args_schema.frontend_port_range_start = AAZIntArg( - options=["--frontend-port-range-start"], - arg_group="Properties", - help="The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the inbound NAT pool.", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPortRangeEnd", AAZIntType, ".frontend_port_range_end", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("frontendPortRangeStart", AAZIntType, ".frontend_port_range_start", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_wait.py deleted file mode 100644 index a212167efc9..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_pool/_wait.py +++ /dev/null @@ -1,1046 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.inboundNatPools[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/__cmd_group.py deleted file mode 100644 index a55f1585dd7..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb inbound-nat-rule", -) -class __CMDGroup(AAZCommandGroup): - """Manage inbound NAT rules of a load balancer. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_create.py deleted file mode 100644 index 4a7f98d0625..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_create.py +++ /dev/null @@ -1,1272 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule create", -) -class Create(AAZCommand): - """Create an inbound NAT rule. - - :example: Create a basic inbound NAT rule for port 80. - az network lb inbound-nat-rule create -g MyResourceGroup --lb-name MyLb -n MyNatRule --protocol Tcp --frontend-port 80 --backend-port 80 - - :example: Create a basic inbound NAT rule for a specific frontend IP and enable floating IP for NAT Rule. - az network lb inbound-nat-rule create -g MyResourceGroup --lb-name MyLb -n MyNatRule --protocol Tcp --frontend-port 5432 --backend-port 3389 --frontend-ip MyFrontendIp --floating-ip true - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.inboundNatRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer.", - required=True, - ) - - # define Arg Group "Parameters.properties.inboundNatRules[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _args_schema.enable_floating_ip = AAZBoolArg( - options=["--floating-ip", "--enable-floating-ip"], - arg_group="Properties", - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name of ID of the frontend IP configuration.", - ) - _args_schema.frontend_port = AAZIntArg( - options=["--frontend-port"], - arg_group="Properties", - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the load balancing rule.", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_delete.py deleted file mode 100644 index 8869258a405..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_delete.py +++ /dev/null @@ -1,1205 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule delete", -) -class Delete(AAZCommand): - """Delete an inbound NAT rule. - - :example: Delete an inbound NAT rule. - az network lb inbound-nat-rule delete -g MyResourceGroup --lb-name MyLb -n MyNatRule - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.inboundNatRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_list.py deleted file mode 100644 index ea657c59e1a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_list.py +++ /dev/null @@ -1,1061 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule list", -) -class List(AAZCommand): - """List inbound NAT rules. - - :example: List inbound NAT rules. - az network lb inbound-nat-rule list -g MyResourceGroup --lb-name MyLb - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.inboundNatRules"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.inboundNatRules - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.inboundNatRules = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_show.py deleted file mode 100644 index fdbe8006724..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_show.py +++ /dev/null @@ -1,1080 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule show", -) -class Show(AAZCommand): - """Get the details of an inbound NAT rule. - - :example: Get the details of an inbound NAT rule. - az network lb inbound-nat-rule show -g MyResourceGroup --lb-name MyLb -n MyNatRule - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.inboundNatRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_update.py deleted file mode 100644 index 58adcfe098e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_update.py +++ /dev/null @@ -1,1287 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule update", -) -class Update(AAZCommand): - """Update an inbound NAT rule. - - :example: Update an inbound NAT rule to disable floating IP and modify idle timeout duration. - az network lb inbound-nat-rule update -g MyResourceGroup --lb-name MyLb -n MyNatRule --floating-ip false --idle-timeout 5 - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.inboundNatRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer.", - required=True, - ) - - # define Arg Group "Parameters.properties.inboundNatRules[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - nullable=True, - ) - _args_schema.enable_floating_ip = AAZBoolArg( - options=["--floating-ip", "--enable-floating-ip"], - arg_group="Properties", - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name of ID of the frontend IP configuration.", - nullable=True, - ) - _args_schema.frontend_port = AAZIntArg( - options=["--frontend-port"], - arg_group="Properties", - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - nullable=True, - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the load balancing rule.", - nullable=True, - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_wait.py deleted file mode 100644 index 279383501ff..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/inbound_nat_rule/_wait.py +++ /dev/null @@ -1,1046 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.inboundNatRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/__cmd_group.py deleted file mode 100644 index 2cf6c0a3e84..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb probe", -) -class __CMDGroup(AAZCommandGroup): - """Evaluate probe information and define routing rules. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_create.py deleted file mode 100644 index 8bbdd32f56a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_create.py +++ /dev/null @@ -1,1262 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe create", -) -class Create(AAZCommand): - """Create a probe in the load balance. - - :example: Create a probe on a load balancer over HTTP and port 80. - az network lb probe create -g MyResourceGroup --lb-name MyLb -n MyProbe --protocol http --port 80 --path / - - :example: Create a probe on a load balancer over TCP on port 443. - az network lb probe create -g MyResourceGroup --lb-name MyLb -n MyProbe --protocol tcp --port 443 - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.probes[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the probe.", - required=True, - ) - - # define Arg Group "Parameters.properties.probes[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.interval_in_seconds = AAZIntArg( - options=["--interval", "--interval-in-seconds"], - arg_group="Properties", - help={"short-summary": "The interval, in seconds, for how frequently to probe the endpoint for health status.", "long-summary": "Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5."}, - ) - _args_schema.number_of_probes = AAZIntArg( - options=["--threshold", "--number-of-probes"], - arg_group="Properties", - help={"short-summary": "The number of consecutive probe failures before an instance is deemed unhealthy.", "long-summary": "This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure."}, - ) - _args_schema.port = AAZIntArg( - options=["--port"], - arg_group="Properties", - help="The port for communicating the probe. Possible values range from 1 to 65535, inclusive.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help={"short-summary": "The protocol of the end point.", "long-summary": "If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful."}, - enum={"Http": "Http", "Tcp": "Tcp"}, - ) - _args_schema.request_path = AAZStrArg( - options=["--path", "--request-path"], - arg_group="Properties", - help="The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("intervalInSeconds", AAZIntType, ".interval_in_seconds") - properties.set_prop("numberOfProbes", AAZIntType, ".number_of_probes") - properties.set_prop("port", AAZIntType, ".port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("requestPath", AAZStrType, ".request_path") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_delete.py deleted file mode 100644 index 3d83476f011..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_delete.py +++ /dev/null @@ -1,1205 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe delete", -) -class Delete(AAZCommand): - """Delete a probe in the load balancer. - - :example: Delete a probe. - az network lb probe delete -g MyResourceGroup --lb-name MyLb -n MyProbe - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.probes[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the probe.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_list.py deleted file mode 100644 index 4ee99269c2c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_list.py +++ /dev/null @@ -1,1061 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe list", -) -class List(AAZCommand): - """List probes in the load balancer. - - :example: List probes - az network lb probe list -g MyResourceGroup --lb-name MyLb - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.probes"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.probes - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.probes = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_show.py deleted file mode 100644 index e525a0a091c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_show.py +++ /dev/null @@ -1,1080 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe show", -) -class Show(AAZCommand): - """Get the details of a probe in the load balancer. - - :example: Get the details of a probe. - az network lb probe show -g MyResourceGroup --lb-name MyLb -n MyProbe - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.probes[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the probe.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_update.py deleted file mode 100644 index 833cd61eda6..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_update.py +++ /dev/null @@ -1,1274 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe update", -) -class Update(AAZCommand): - """Update a probe in the load balancer. - - :example: Update a probe with a different port and interval. - az network lb probe update -g MyResourceGroup --lb-name MyLb -n MyProbe --port 81 --interval 10 - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.probes[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the probe.", - required=True, - ) - - # define Arg Group "Parameters.properties.probes[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.interval_in_seconds = AAZIntArg( - options=["--interval", "--interval-in-seconds"], - arg_group="Properties", - help={"short-summary": "The interval, in seconds, for how frequently to probe the endpoint for health status.", "long-summary": "Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5."}, - nullable=True, - ) - _args_schema.number_of_probes = AAZIntArg( - options=["--threshold", "--number-of-probes"], - arg_group="Properties", - help={"short-summary": "The number of consecutive probe failures before an instance is deemed unhealthy.", "long-summary": "This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure."}, - nullable=True, - ) - _args_schema.port = AAZIntArg( - options=["--port"], - arg_group="Properties", - help="The port for communicating the probe. Possible values range from 1 to 65535, inclusive.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help={"short-summary": "The protocol of the end point.", "long-summary": "If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful."}, - enum={"Http": "Http", "Tcp": "Tcp"}, - ) - _args_schema.request_path = AAZStrArg( - options=["--path", "--request-path"], - arg_group="Properties", - help="The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed.", - nullable=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("intervalInSeconds", AAZIntType, ".interval_in_seconds") - properties.set_prop("numberOfProbes", AAZIntType, ".number_of_probes") - properties.set_prop("port", AAZIntType, ".port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("requestPath", AAZStrType, ".request_path") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_wait.py deleted file mode 100644 index 6d32a828320..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/probe/_wait.py +++ /dev/null @@ -1,1046 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.probes[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/__cmd_group.py deleted file mode 100644 index 812e7da7710..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb rule", -) -class __CMDGroup(AAZCommandGroup): - """Manage load balancing rules. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_create.py deleted file mode 100644 index 38457e0a50c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_create.py +++ /dev/null @@ -1,1303 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule create", -) -class Create(AAZCommand): - """Create a load balancing rule. - - :example: Create a load balancing rule that assigns a front-facing IP configuration and port to an address pool and port. - az network lb rule create -g MyResourceGroup --lb-name MyLb -n MyLbRule --protocol Tcp --frontend-ip MyFrontEndIp --frontend-port 80 --backend-pool-name MyAddressPool --backend-port 80 - - :example: Create a load balancing rule that assigns a front-facing IP configuration and port to an address pool and port with the floating ip feature. - az network lb rule create -g MyResourceGroup --lb-name MyLb -n MyLbRule --protocol Tcp --frontend-ip MyFrontEndIp --backend-pool-name MyAddressPool --floating-ip true --frontend-port 80 --backend-port 80 - - :example: Create an HA ports load balancing rule that assigns a frontend IP and port to use all available backend IPs in a pool on the same port. - az network lb rule create -g MyResourceGroup --lb-name MyLb -n MyHAPortsRule --protocol All --frontend-port 0 --backend-port 0 --frontend-ip MyFrontendIp --backend-pool-name MyAddressPool - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.loadBalancingRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the load balancing rule.", - required=True, - ) - - # define Arg Group "Parameters.properties.loadBalancingRules[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_address_pool = AAZStrArg( - options=["--backend-pool-name", "--backend-address-pool"], - arg_group="Properties", - help="The name or ID of the backend address pool", - ) - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables \"Any Port\".", - ) - _args_schema.enable_floating_ip = AAZBoolArg( - options=["--floating-ip", "--enable-floating-ip"], - arg_group="Properties", - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name of ID of the frontend IP configuration.", - ) - _args_schema.frontend_port = AAZIntArg( - options=["--frontend-port"], - arg_group="Properties", - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables \"Any Port\".", - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _args_schema.load_distribution = AAZStrArg( - options=["--load-distribution"], - arg_group="Properties", - help="The load distribution policy for this rule.", - default="Default", - enum={"Default": "Default", "SourceIP": "SourceIP", "SourceIPProtocol": "SourceIPProtocol"}, - ) - _args_schema.probe_name = AAZStrArg( - options=["--probe", "--probe-name"], - arg_group="Properties", - help="The ID or Name of an existing probe to associate with this rule.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the load balancing rule.", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendAddressPool", AAZObjectType) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("loadDistribution", AAZStrType, ".load_distribution") - properties.set_prop("probe", AAZObjectType) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - backend_address_pool = _builder.get(".properties.backendAddressPool") - if backend_address_pool is not None: - backend_address_pool.set_prop("id", AAZStrType, ".backend_address_pool") - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - probe = _builder.get(".properties.probe") - if probe is not None: - probe.set_prop("id", AAZStrType, ".probe_name") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_delete.py deleted file mode 100644 index e32832d2b1a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_delete.py +++ /dev/null @@ -1,1205 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule delete", -) -class Delete(AAZCommand): - """Delete a load balancing rule. - - :example: Delete a load balancing rule. - az network lb rule delete -g MyResourceGroup --lb-name MyLb -n MyLbRule - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.loadBalancingRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the load balancing rule.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_list.py deleted file mode 100644 index 901807faa85..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_list.py +++ /dev/null @@ -1,1061 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule list", -) -class List(AAZCommand): - """List load balancing rules. - - :example: List load balancing rules. - az network lb rule list -g MyResourceGroup --lb-name MyLb -o table - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.loadBalancingRules"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.loadBalancingRules - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.loadBalancingRules = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_show.py deleted file mode 100644 index 452d855786a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_show.py +++ /dev/null @@ -1,1080 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule show", -) -class Show(AAZCommand): - """Get the details of a load balancing rule. - - :example: Get the details of a load balancing rule. - az network lb rule show -g MyResourceGroup --lb-name MyLb -n MyLbRule - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.loadBalancingRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the load balancing rule.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_update.py deleted file mode 100644 index e056ffa2a5f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_update.py +++ /dev/null @@ -1,1318 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule update", -) -class Update(AAZCommand): - """Update a load balancing rule. - - :example: Update a load balancing rule to change the protocol to UDP. - az network lb rule update -g MyResourceGroup --lb-name MyLb -n MyLbRule --protocol Udp - - :example: Update a load balancing rule to support HA ports. - az network lb rule update -g MyResourceGroup --lb-name MyLb -n MyLbRule --protocol All --frontend-port 0 --backend-port 0 - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.loadBalancingRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the load balancing rule.", - required=True, - ) - - # define Arg Group "Parameters.properties.loadBalancingRules[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_address_pool = AAZStrArg( - options=["--backend-pool-name", "--backend-address-pool"], - arg_group="Properties", - help="The name or ID of the backend address pool", - nullable=True, - ) - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables \"Any Port\".", - nullable=True, - ) - _args_schema.enable_floating_ip = AAZBoolArg( - options=["--floating-ip", "--enable-floating-ip"], - arg_group="Properties", - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name of ID of the frontend IP configuration.", - nullable=True, - ) - _args_schema.frontend_port = AAZIntArg( - options=["--frontend-port"], - arg_group="Properties", - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables \"Any Port\".", - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _args_schema.load_distribution = AAZStrArg( - options=["--load-distribution"], - arg_group="Properties", - help="The load distribution policy for this rule.", - nullable=True, - enum={"Default": "Default", "SourceIP": "SourceIP", "SourceIPProtocol": "SourceIPProtocol"}, - ) - _args_schema.probe_name = AAZStrArg( - options=["--probe", "--probe-name"], - arg_group="Properties", - help="The ID or Name of an existing probe to associate with this rule.", - nullable=True, - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the load balancing rule.", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendAddressPool", AAZObjectType) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("loadDistribution", AAZStrType, ".load_distribution") - properties.set_prop("probe", AAZObjectType) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - backend_address_pool = _builder.get(".properties.backendAddressPool") - if backend_address_pool is not None: - backend_address_pool.set_prop("id", AAZStrType, ".backend_address_pool") - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - probe = _builder.get(".properties.probe") - if probe is not None: - probe.set_prop("id", AAZStrType, ".probe_name") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_wait.py deleted file mode 100644 index 513aaa09105..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/lb/rule/_wait.py +++ /dev/null @@ -1,1046 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2015-06-15", "properties.loadBalancingRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/__cmd_group.py deleted file mode 100644 index d8d6d8ce87e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/__cmd_group.py +++ /dev/null @@ -1,26 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 local-gateway", -) -class __CMDGroup(AAZCommandGroup): - """Manage local gateways. - - For more information on local gateways, visit: - https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-cli#localnet. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_create.py deleted file mode 100644 index 1d134cad6d0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_create.py +++ /dev/null @@ -1,329 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway create", -) -class Create(AAZCommand): - """Create a local VPN gateway. - - :example: Create a Local Network Gateway to represent your on-premises site. - az network local-gateway create -g MyResourceGroup -n MyLocalGateway --gateway-ip-address 23.99.221.164 --local-address-prefixes 10.0.0.0/24 20.0.0.0/24 - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the local network gateway.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "BGP Peering" - - _args_schema = cls._args_schema - _args_schema.asn = AAZIntArg( - options=["--asn"], - arg_group="BGP Peering", - help="Autonomous System Number to use for the BGP settings.", - ) - _args_schema.bgp_peering_address = AAZStrArg( - options=["--bgp-peering-address"], - arg_group="BGP Peering", - help="IP address from the OnPremise VPN's subnet to use for BGP peering.", - ) - _args_schema.peer_weight = AAZIntArg( - options=["--peer-weight"], - arg_group="BGP Peering", - help="Weight (0-100) added to routes learned through BGP peering.", - ) - - # define Arg Group "LocalNetworkAddressSpace" - - _args_schema = cls._args_schema - _args_schema.local_address_prefixes = AAZListArg( - options=["--address-prefixes", "--local-address-prefixes"], - arg_group="LocalNetworkAddressSpace", - help="List of CIDR block prefixes representing the address space of the OnPremise VPN's subnet.", - ) - - local_address_prefixes = cls._args_schema.local_address_prefixes - local_address_prefixes.Element = AAZStrArg() - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - arg_group="Parameters", - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Parameters", - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.gateway_ip_address = AAZStrArg( - options=["--gateway-ip-address"], - arg_group="Properties", - help="Gateway's public IP address. (e.g. 10.1.1.1).", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.LocalNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LocalNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("bgpSettings", AAZObjectType) - properties.set_prop("gatewayIpAddress", AAZStrType, ".gateway_ip_address") - properties.set_prop("localNetworkAddressSpace", AAZObjectType) - - bgp_settings = _builder.get(".properties.bgpSettings") - if bgp_settings is not None: - bgp_settings.set_prop("asn", AAZIntType, ".asn") - bgp_settings.set_prop("bgpPeeringAddress", AAZStrType, ".bgp_peering_address") - bgp_settings.set_prop("peerWeight", AAZIntType, ".peer_weight") - - local_network_address_space = _builder.get(".properties.localNetworkAddressSpace") - if local_network_address_space is not None: - local_network_address_space.set_prop("addressPrefixes", AAZListType, ".local_address_prefixes") - - address_prefixes = _builder.get(".properties.localNetworkAddressSpace.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.location = AAZStrType() - _schema_on_200_201.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200_201.tags = AAZDictType() - _schema_on_200_201.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - bgp_settings = cls._schema_on_200_201.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - local_network_address_space = cls._schema_on_200_201.properties.local_network_address_space - local_network_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200_201.properties.local_network_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - tags = cls._schema_on_200_201.tags - tags.Element = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_delete.py deleted file mode 100644 index c359dd3d428..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_delete.py +++ /dev/null @@ -1,164 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway delete", -) -class Delete(AAZCommand): - """Delete a local VPN gateway. - - In order to delete a Local Network Gateway, you must first delete ALL Connection objects in Azure that are connected to the Gateway. After deleting the Gateway, proceed to delete other resources now not in use. For more information, follow the order of instructions on this page: https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-delete-vnet-gateway-portal - - :example: Delete a Local Network Gateway. - az network local-gateway delete -g MyResourceGroup -n MyLocalGateway - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the local network gateway.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.LocalNetworkGatewaysDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class LocalNetworkGatewaysDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_list.py deleted file mode 100644 index 94a02eae88a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_list.py +++ /dev/null @@ -1,213 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway list", -) -class List(AAZCommand): - """List all local VPN gateways in a resource group. - - :example: List all local VPN gateways in a resource group. - az network local-gateway list -g MyResourceGroup - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LocalNetworkGatewaysList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class LocalNetworkGatewaysList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - bgp_settings = cls._schema_on_200.value.Element.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - local_network_address_space = cls._schema_on_200.value.Element.properties.local_network_address_space - local_network_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.value.Element.properties.local_network_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_show.py deleted file mode 100644 index 208f0406d6d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_show.py +++ /dev/null @@ -1,214 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway show", -) -class Show(AAZCommand): - """Get the details of a local VPN gateway. - - :example: Get the details of a local VPN gateway. - az network local-gateway show -g MyResourceGroup -n MyLocalGateway - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the local network gateway.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LocalNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LocalNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - bgp_settings = cls._schema_on_200.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - local_network_address_space = cls._schema_on_200.properties.local_network_address_space - local_network_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.local_network_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_update.py deleted file mode 100644 index f216b902948..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_update.py +++ /dev/null @@ -1,479 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway update", -) -class Update(AAZCommand): - """Update a local VPN gateway. - - :example: Update a Local Network Gateway provisioned with a 10.0.0.0/24 address prefix with additional prefixes. - az network local-gateway update -g MyResourceGroup -n MyLocalGateway --address-prefixes 10.0.0.0/24 20.0.0.0/24 30.0.0.0/24 - - :example: Update a local VPN gateway. (autogenerated) - az network local-gateway update --gateway-ip-address 23.99.221.164 --name MyLocalGateway --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the local network gateway.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "BGP Peering" - - _args_schema = cls._args_schema - _args_schema.asn = AAZIntArg( - options=["--asn"], - arg_group="BGP Peering", - help="Autonomous System Number to use for the BGP settings.", - nullable=True, - ) - _args_schema.bgp_peering_address = AAZStrArg( - options=["--bgp-peering-address"], - arg_group="BGP Peering", - help="IP address from the OnPremise VPN's subnet to use for BGP peering.", - nullable=True, - ) - _args_schema.peer_weight = AAZIntArg( - options=["--peer-weight"], - arg_group="BGP Peering", - help="Weight (0-100) added to routes learned through BGP peering.", - nullable=True, - ) - - # define Arg Group "LocalNetworkAddressSpace" - - _args_schema = cls._args_schema - _args_schema.local_address_prefixes = AAZListArg( - options=["--address-prefixes", "--local-address-prefixes"], - arg_group="LocalNetworkAddressSpace", - help="List of CIDR block prefixes representing the address space of the OnPremise VPN's subnet.", - nullable=True, - ) - - local_address_prefixes = cls._args_schema.local_address_prefixes - local_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Parameters", - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.gateway_ip_address = AAZStrArg( - options=["--gateway-ip-address"], - arg_group="Properties", - help="Gateway's public IP address. (e.g. 10.1.1.1).", - nullable=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LocalNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.LocalNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LocalNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_local_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LocalNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_local_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("bgpSettings", AAZObjectType) - properties.set_prop("gatewayIpAddress", AAZStrType, ".gateway_ip_address") - properties.set_prop("localNetworkAddressSpace", AAZObjectType) - - bgp_settings = _builder.get(".properties.bgpSettings") - if bgp_settings is not None: - bgp_settings.set_prop("asn", AAZIntType, ".asn") - bgp_settings.set_prop("bgpPeeringAddress", AAZStrType, ".bgp_peering_address") - bgp_settings.set_prop("peerWeight", AAZIntType, ".peer_weight") - - local_network_address_space = _builder.get(".properties.localNetworkAddressSpace") - if local_network_address_space is not None: - local_network_address_space.set_prop("addressPrefixes", AAZListType, ".local_address_prefixes") - - address_prefixes = _builder.get(".properties.localNetworkAddressSpace.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_local_network_gateway_read = None - - @classmethod - def _build_schema_local_network_gateway_read(cls, _schema): - if cls._schema_local_network_gateway_read is not None: - _schema.etag = cls._schema_local_network_gateway_read.etag - _schema.id = cls._schema_local_network_gateway_read.id - _schema.location = cls._schema_local_network_gateway_read.location - _schema.name = cls._schema_local_network_gateway_read.name - _schema.properties = cls._schema_local_network_gateway_read.properties - _schema.tags = cls._schema_local_network_gateway_read.tags - _schema.type = cls._schema_local_network_gateway_read.type - return - - cls._schema_local_network_gateway_read = _schema_local_network_gateway_read = AAZObjectType() - - local_network_gateway_read = _schema_local_network_gateway_read - local_network_gateway_read.etag = AAZStrType() - local_network_gateway_read.id = AAZStrType() - local_network_gateway_read.location = AAZStrType() - local_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - local_network_gateway_read.tags = AAZDictType() - local_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_local_network_gateway_read.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - bgp_settings = _schema_local_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - local_network_address_space = _schema_local_network_gateway_read.properties.local_network_address_space - local_network_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_local_network_gateway_read.properties.local_network_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - tags = _schema_local_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_local_network_gateway_read.etag - _schema.id = cls._schema_local_network_gateway_read.id - _schema.location = cls._schema_local_network_gateway_read.location - _schema.name = cls._schema_local_network_gateway_read.name - _schema.properties = cls._schema_local_network_gateway_read.properties - _schema.tags = cls._schema_local_network_gateway_read.tags - _schema.type = cls._schema_local_network_gateway_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_wait.py deleted file mode 100644 index 3cbfd80f31d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/local_gateway/_wait.py +++ /dev/null @@ -1,210 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the local network gateway.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LocalNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LocalNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - bgp_settings = cls._schema_on_200.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - local_network_address_space = cls._schema_on_200.properties.local_network_address_space - local_network_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.local_network_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/__cmd_group.py deleted file mode 100644 index fc5808be9b0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 nic", -) -class __CMDGroup(AAZCommandGroup): - """Manage network interfaces. - - To learn more about network interfaces in Azure, visit https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-network-interface?tabs=network-interface-portal. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_create.py deleted file mode 100644 index 78f83a3e0c8..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_create.py +++ /dev/null @@ -1,2385 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic create", -) -class Create(AAZCommand): - """Create a network interface. - - :example: Create a network interface for a specified subnet on a specified virtual network. - az network nic create -g MyResourceGroup --vnet-name MyVnet --subnet MySubnet -n MyNic - - :example: Create a network interface for a specified subnet on a virtual network which allows IP forwarding subject to a network security group. - az network nic create -g MyResourceGroup --vnet-name MyVnet --subnet MySubnet -n MyNic --ip-forwarding --network-security-group MyNsg - - :example: Create a network interface for a specified subnet on a virtual network with network security group and application security groups. - az network nic create -g MyResourceGroup --vnet-name MyVnet --subnet MySubnet -n MyNic --network-security-group MyNsg --application-security-groups Web App - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.ip_forwarding = AAZBoolArg( - options=["--ip-forwarding"], - help="Whether to enable IP forwarding.", - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "DNS" - - _args_schema = cls._args_schema - _args_schema.dns_servers = AAZListArg( - options=["--dns-servers"], - arg_group="DNS", - help="Space-separated list of DNS server IP addresses.", - ) - _args_schema.internal_dns_name = AAZStrArg( - options=["--internal-dns-name"], - arg_group="DNS", - help="Name of internal DNS label.", - ) - - dns_servers = cls._args_schema.dns_servers - dns_servers.Element = AAZStrArg() - - # define Arg Group "DnsSettings" - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.ip_configurations = AAZListArg( - options=["--ip-configurations"], - arg_group="Properties", - help="A list of IPConfigurations of the network interface.", - ) - _args_schema.nsg = AAZObjectArg( - options=["--nsg"], - arg_group="Properties", - help="The reference to the NetworkSecurityGroup resource.", - ) - - ip_configurations = cls._args_schema.ip_configurations - ip_configurations.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference to LoadBalancerBackendAddressPool resource.", - ) - _element.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - ) - _element.primary = AAZBoolArg( - options=["primary"], - help="Whether this is a primary customer address on the network interface.", - ) - _element.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="Private IP address of the IP configuration.", - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Allocation method of private IP address.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address bound to the IP configuration.", - ) - _element.subnet = AAZObjectArg( - options=["subnet"], - help="Subnet bound to the IP configuration.", - ) - - load_balancer_backend_address_pools = cls._args_schema.ip_configurations.Element.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element.load_balancer_backend_address_pools.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resource.", - ) - - load_balancer_inbound_nat_rules = cls._args_schema.ip_configurations.Element.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element.load_balancer_inbound_nat_rules.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource.", - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The reference to the transport protocol used by the load balancing rule.", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - - public_ip_address = cls._args_schema.ip_configurations.Element.public_ip_address - public_ip_address.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - ) - public_ip_address.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - ) - public_ip_address.ip_address = AAZStrArg( - options=["ip-address"], - help="The IP address associated with the public IP address resource.", - ) - public_ip_address.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP address allocation method.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_schema.ip_configurations.Element.public_ip_address.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="The domain name label. The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="The reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN.", - ) - - tags = cls._args_schema.ip_configurations.Element.public_ip_address.tags - tags.Element = AAZStrArg() - - subnet = cls._args_schema.ip_configurations.Element.subnet - subnet.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualnetworks/{}/subnets/{}", - ), - ) - subnet.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - subnet.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - subnet.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_create(subnet.network_security_group) - subnet.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - ) - - route_table = cls._args_schema.ip_configurations.Element.subnet.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_schema.ip_configurations.Element.subnet.route_table.routes - routes.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element.subnet.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - subnets = cls._args_schema.ip_configurations.Element.subnet.route_table.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_create(subnets.Element) - - tags = cls._args_schema.ip_configurations.Element.subnet.route_table.tags - tags.Element = AAZStrArg() - - nsg = cls._args_schema.nsg - nsg.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - nsg.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - nsg.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - nsg.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - nsg.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - ) - nsg.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - nsg.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - nsg.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - nsg.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - nsg.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_schema.nsg.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_create(default_security_rules.Element) - - network_interfaces = cls._args_schema.nsg.network_interfaces - network_interfaces.Element = AAZObjectArg() - cls._build_args_network_interface_create(network_interfaces.Element) - - security_rules = cls._args_schema.nsg.security_rules - security_rules.Element = AAZObjectArg() - - _element = cls._args_schema.nsg.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - - subnets = cls._args_schema.nsg.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_create(subnets.Element) - - tags = cls._args_schema.nsg.tags - tags.Element = AAZStrArg() - return cls._args_schema - - _args_network_interface_create = None - - @classmethod - def _build_args_network_interface_create(cls, _schema): - if cls._args_network_interface_create is not None: - _schema.dns_settings = cls._args_network_interface_create.dns_settings - _schema.enable_ip_forwarding = cls._args_network_interface_create.enable_ip_forwarding - _schema.etag = cls._args_network_interface_create.etag - _schema.id = cls._args_network_interface_create.id - _schema.ip_configurations = cls._args_network_interface_create.ip_configurations - _schema.location = cls._args_network_interface_create.location - _schema.mac_address = cls._args_network_interface_create.mac_address - _schema.network_security_group = cls._args_network_interface_create.network_security_group - _schema.primary = cls._args_network_interface_create.primary - _schema.provisioning_state = cls._args_network_interface_create.provisioning_state - _schema.resource_guid = cls._args_network_interface_create.resource_guid - _schema.tags = cls._args_network_interface_create.tags - _schema.virtual_machine = cls._args_network_interface_create.virtual_machine - return - - cls._args_network_interface_create = AAZObjectArg() - - network_interface_create = cls._args_network_interface_create - network_interface_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_interface_create.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - network_interface_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_interface_create.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - ) - network_interface_create.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - ) - network_interface_create.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - ) - network_interface_create.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - ) - network_interface_create.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_create(network_interface_create.network_security_group) - network_interface_create.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - ) - network_interface_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - network_interface_create.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - ) - network_interface_create.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - ) - cls._build_args_sub_resource_create(network_interface_create.virtual_machine) - network_interface_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_network_interface_create.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - ) - - applied_dns_servers = cls._args_network_interface_create.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg() - - dns_servers = cls._args_network_interface_create.dns_settings.dns_servers - dns_servers.Element = AAZStrArg() - - ip_configurations = cls._args_network_interface_create.ip_configurations - ip_configurations.Element = AAZObjectArg() - - _element = cls._args_network_interface_create.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - ) - _element.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - ) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - ) - _element.private_ip_address = AAZStrArg( - options=["private-ip-address"], - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address resource.", - ) - _element.subnet = AAZObjectArg( - options=["subnet"], - ) - cls._build_args_subnet_create(_element.subnet) - - load_balancer_backend_address_pools = cls._args_network_interface_create.ip_configurations.Element.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_network_interface_create.ip_configurations.Element.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - load_balancer_inbound_nat_rules = cls._args_network_interface_create.ip_configurations.Element.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_network_interface_create.ip_configurations.Element.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - public_ip_address = cls._args_network_interface_create.ip_configurations.Element.public_ip_address - public_ip_address.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - public_ip_address.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - ) - public_ip_address.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - ) - public_ip_address.ip_address = AAZStrArg( - options=["ip-address"], - ) - public_ip_address.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - public_ip_address.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - ) - public_ip_address.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_network_interface_create.ip_configurations.Element.public_ip_address.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - ) - - tags = cls._args_network_interface_create.ip_configurations.Element.public_ip_address.tags - tags.Element = AAZStrArg() - - tags = cls._args_network_interface_create.tags - tags.Element = AAZStrArg() - - _schema.dns_settings = cls._args_network_interface_create.dns_settings - _schema.enable_ip_forwarding = cls._args_network_interface_create.enable_ip_forwarding - _schema.etag = cls._args_network_interface_create.etag - _schema.id = cls._args_network_interface_create.id - _schema.ip_configurations = cls._args_network_interface_create.ip_configurations - _schema.location = cls._args_network_interface_create.location - _schema.mac_address = cls._args_network_interface_create.mac_address - _schema.network_security_group = cls._args_network_interface_create.network_security_group - _schema.primary = cls._args_network_interface_create.primary - _schema.provisioning_state = cls._args_network_interface_create.provisioning_state - _schema.resource_guid = cls._args_network_interface_create.resource_guid - _schema.tags = cls._args_network_interface_create.tags - _schema.virtual_machine = cls._args_network_interface_create.virtual_machine - - _args_network_security_group_create = None - - @classmethod - def _build_args_network_security_group_create(cls, _schema): - if cls._args_network_security_group_create is not None: - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.id = cls._args_network_security_group_create.id - _schema.location = cls._args_network_security_group_create.location - _schema.network_interfaces = cls._args_network_security_group_create.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_create.provisioning_state - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.subnets = cls._args_network_security_group_create.subnets - _schema.tags = cls._args_network_security_group_create.tags - return - - cls._args_network_security_group_create = AAZObjectArg() - - network_security_group_create = cls._args_network_security_group_create - network_security_group_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_create.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - network_security_group_create.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - ) - network_security_group_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - network_security_group_create.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - network_security_group_create.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group_create.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - network_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_network_security_group_create.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_create(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_create.network_interfaces - network_interfaces.Element = AAZObjectArg() - cls._build_args_network_interface_create(network_interfaces.Element) - - security_rules = cls._args_network_security_group_create.security_rules - security_rules.Element = AAZObjectArg() - - _element = cls._args_network_security_group_create.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - - subnets = cls._args_network_security_group_create.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_create(subnets.Element) - - tags = cls._args_network_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.id = cls._args_network_security_group_create.id - _schema.location = cls._args_network_security_group_create.location - _schema.network_interfaces = cls._args_network_security_group_create.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_create.provisioning_state - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.subnets = cls._args_network_security_group_create.subnets - _schema.tags = cls._args_network_security_group_create.tags - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_port_range = cls._args_security_rule_create.source_port_range - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_port_range = cls._args_security_rule_create.source_port_range - - _args_sub_resource_create = None - - @classmethod - def _build_args_sub_resource_create(cls, _schema): - if cls._args_sub_resource_create is not None: - _schema.id = cls._args_sub_resource_create.id - return - - cls._args_sub_resource_create = AAZObjectArg() - - sub_resource_create = cls._args_sub_resource_create - sub_resource_create.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - - _schema.id = cls._args_sub_resource_create.id - - _args_subnet_create = None - - @classmethod - def _build_args_subnet_create(cls, _schema): - if cls._args_subnet_create is not None: - _schema.address_prefix = cls._args_subnet_create.address_prefix - _schema.etag = cls._args_subnet_create.etag - _schema.name = cls._args_subnet_create.name - _schema.network_security_group = cls._args_subnet_create.network_security_group - _schema.provisioning_state = cls._args_subnet_create.provisioning_state - _schema.route_table = cls._args_subnet_create.route_table - return - - cls._args_subnet_create = AAZObjectArg() - - subnet_create = cls._args_subnet_create - subnet_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - subnet_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - subnet_create.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - subnet_create.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_create(subnet_create.network_security_group) - subnet_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - ) - subnet_create.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - ) - - route_table = cls._args_subnet_create.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_subnet_create.route_table.routes - routes.Element = AAZObjectArg() - - _element = cls._args_subnet_create.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - subnets = cls._args_subnet_create.route_table.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_create(subnets.Element) - - tags = cls._args_subnet_create.route_table.tags - tags.Element = AAZStrArg() - - _schema.address_prefix = cls._args_subnet_create.address_prefix - _schema.etag = cls._args_subnet_create.etag - _schema.name = cls._args_subnet_create.name - _schema.network_security_group = cls._args_subnet_create.network_security_group - _schema.provisioning_state = cls._args_subnet_create.provisioning_state - _schema.route_table = cls._args_subnet_create.route_table - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType) - properties.set_prop("enableIPForwarding", AAZBoolType, ".ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("networkSecurityGroup", AAZObjectType, ".nsg") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name") - - dns_servers = _builder.get(".properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address") - properties.set_prop("subnet", AAZObjectType, ".subnet") - - load_balancer_backend_address_pools = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - load_balancer_inbound_nat_rules = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - - public_ip_address = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".id") - public_ip_address.set_prop("location", AAZStrType, ".location") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - public_ip_address.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - - dns_settings = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - subnet = _builder.get(".properties.ipConfigurations[].properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".id") - subnet.set_prop("name", AAZStrType, ".name") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - _CreateHelper._build_schema_network_security_group_create(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - route_table = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.subnets") - if subnets is not None: - _CreateHelper._build_schema_subnet_create(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - network_security_group = _builder.get(".properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("etag", AAZStrType, ".etag") - network_security_group.set_prop("id", AAZStrType, ".id") - network_security_group.set_prop("location", AAZStrType, ".location") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - network_security_group.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkSecurityGroup.properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.networkSecurityGroup.properties.defaultSecurityRules") - if default_security_rules is not None: - _CreateHelper._build_schema_security_rule_create(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkSecurityGroup.properties.networkInterfaces") - if network_interfaces is not None: - _CreateHelper._build_schema_network_interface_create(network_interfaces.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.networkSecurityGroup.properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkSecurityGroup.properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - subnets = _builder.get(".properties.networkSecurityGroup.properties.subnets") - if subnets is not None: - _CreateHelper._build_schema_subnet_create(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkSecurityGroup.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_network_interface_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - cls._build_schema_network_security_group_create(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_create(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address") - cls._build_schema_subnet_create(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - load_balancer_backend_address_pools = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - load_balancer_inbound_nat_rules = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - public_ip_address = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("etag", AAZStrType, ".etag") - public_ip_address.set_prop("id", AAZStrType, ".id") - public_ip_address.set_prop("location", AAZStrType, ".location") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - public_ip_address.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_create(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - cls._build_schema_network_interface_create(network_interfaces.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_create(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - cls._build_schema_network_security_group_create(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_create(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_delete.py deleted file mode 100644 index 15270b68a5b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic delete", -) -class Delete(AAZCommand): - """Delete a network interface. - - :example: Delete a network interface. - az network nic delete -g MyResourceGroup -n MyNic - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkInterfacesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class NetworkInterfacesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_list.py deleted file mode 100644 index 66ba00b9e59..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_list.py +++ /dev/null @@ -1,839 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic list", -) -class List(AAZCommand): - """List network interfaces. - - To list network interfaces attached to VMs in VM scale sets use `az vmss nic list` or `az vmss nic list-vm-nics`. - - :example: List all NICs by internal DNS suffix. - az network nic list --query "[?dnsSettings.internalDomainNameSuffix=`{dnsSuffix}`]" - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/networkinterfaces", "2015-06-15"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.NetworkInterfacesList(ctx=self.ctx)() - if condition_1: - self.NetworkInterfacesListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class NetworkInterfacesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_network_interface_read(value.Element) - - return cls._schema_on_200 - - class NetworkInterfacesListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_network_interface_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_show.py deleted file mode 100644 index 6c43c3419ef..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_show.py +++ /dev/null @@ -1,757 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic show", -) -class Show(AAZCommand): - """Get the details of a network interface. - - :example: Get the internal domain name suffix of a NIC. - az network nic show -g MyResourceGroup -n MyNic --query "dnsSettings.internalDomainNameSuffix" - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_update.py deleted file mode 100644 index 4df1b0761ac..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_update.py +++ /dev/null @@ -1,2585 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic update", -) -class Update(AAZCommand): - """Update a network interface. - - :example: Update a network interface to use a different network security group. - az network nic update -g MyResourceGroup -n MyNic --network-security-group MyNewNsg - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_forwarding = AAZBoolArg( - options=["--ip-forwarding"], - help="Whether to enable IP forwarding.", - nullable=True, - ) - - # define Arg Group "DNS" - - _args_schema = cls._args_schema - _args_schema.dns_servers = AAZListArg( - options=["--dns-servers"], - arg_group="DNS", - help="Space-separated list of DNS server IP addresses. Use null to revert to default Azure servers.", - nullable=True, - ) - _args_schema.internal_dns_name = AAZStrArg( - options=["--internal-dns-name"], - arg_group="DNS", - help="Name of internal DNS label.", - nullable=True, - ) - - dns_servers = cls._args_schema.dns_servers - dns_servers.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "DnsSettings" - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.nsg = AAZObjectArg( - options=["--nsg"], - arg_group="Properties", - help="The reference to the NetworkSecurityGroup resource.", - nullable=True, - ) - - nsg = cls._args_schema.nsg - nsg.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - nsg.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - nsg.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - nsg.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - nsg.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - nullable=True, - ) - nsg.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - nsg.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - nsg.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - nsg.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - nsg.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_schema.nsg.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - network_interfaces = cls._args_schema.nsg.network_interfaces - network_interfaces.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_network_interface_update(network_interfaces.Element) - - security_rules = cls._args_schema.nsg.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.nsg.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - - subnets = cls._args_schema.nsg.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_schema.nsg.tags - tags.Element = AAZStrArg( - nullable=True, - ) - return cls._args_schema - - _args_network_interface_update = None - - @classmethod - def _build_args_network_interface_update(cls, _schema): - if cls._args_network_interface_update is not None: - _schema.dns_settings = cls._args_network_interface_update.dns_settings - _schema.enable_ip_forwarding = cls._args_network_interface_update.enable_ip_forwarding - _schema.etag = cls._args_network_interface_update.etag - _schema.id = cls._args_network_interface_update.id - _schema.ip_configurations = cls._args_network_interface_update.ip_configurations - _schema.location = cls._args_network_interface_update.location - _schema.mac_address = cls._args_network_interface_update.mac_address - _schema.network_security_group = cls._args_network_interface_update.network_security_group - _schema.primary = cls._args_network_interface_update.primary - _schema.provisioning_state = cls._args_network_interface_update.provisioning_state - _schema.resource_guid = cls._args_network_interface_update.resource_guid - _schema.tags = cls._args_network_interface_update.tags - _schema.virtual_machine = cls._args_network_interface_update.virtual_machine - return - - cls._args_network_interface_update = AAZObjectArg( - nullable=True, - ) - - network_interface_update = cls._args_network_interface_update - network_interface_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_interface_update.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - network_interface_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_interface_update.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - nullable=True, - ) - network_interface_update.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - nullable=True, - ) - network_interface_update.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - nullable=True, - ) - network_interface_update.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - nullable=True, - ) - network_interface_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - network_interface_update.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - nullable=True, - ) - network_interface_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - network_interface_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - nullable=True, - ) - network_interface_update.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - nullable=True, - ) - cls._build_args_sub_resource_update(network_interface_update.virtual_machine) - network_interface_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_network_interface_update.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - nullable=True, - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - nullable=True, - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - nullable=True, - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - nullable=True, - ) - - applied_dns_servers = cls._args_network_interface_update.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg( - nullable=True, - ) - - dns_servers = cls._args_network_interface_update.dns_settings.dns_servers - dns_servers.Element = AAZStrArg( - nullable=True, - ) - - ip_configurations = cls._args_network_interface_update.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_update.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - nullable=True, - ) - _element.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - nullable=True, - ) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - nullable=True, - ) - _element.private_ip_address = AAZStrArg( - options=["private-ip-address"], - nullable=True, - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - nullable=True, - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address resource.", - nullable=True, - ) - _element.subnet = AAZObjectArg( - options=["subnet"], - nullable=True, - ) - - load_balancer_backend_address_pools = cls._args_network_interface_update.ip_configurations.Element.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_update.ip_configurations.Element.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - load_balancer_inbound_nat_rules = cls._args_network_interface_update.ip_configurations.Element.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_update.ip_configurations.Element.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - nullable=True, - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - nullable=True, - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - nullable=True, - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - public_ip_address = cls._args_network_interface_update.ip_configurations.Element.public_ip_address - public_ip_address.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - public_ip_address.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - nullable=True, - ) - public_ip_address.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - nullable=True, - ) - public_ip_address.ip_address = AAZStrArg( - options=["ip-address"], - nullable=True, - ) - public_ip_address.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - public_ip_address.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - nullable=True, - ) - public_ip_address.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_network_interface_update.ip_configurations.Element.public_ip_address.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - nullable=True, - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - nullable=True, - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - nullable=True, - ) - - tags = cls._args_network_interface_update.ip_configurations.Element.public_ip_address.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - subnet = cls._args_network_interface_update.ip_configurations.Element.subnet - subnet.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - subnet.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualnetworks/{}/subnets/{}", - ), - ) - subnet.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - subnet.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - nullable=True, - ) - subnet.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(subnet.network_security_group) - subnet.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - nullable=True, - ) - subnet.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - nullable=True, - ) - - route_table = cls._args_network_interface_update.ip_configurations.Element.subnet.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - nullable=True, - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - routes = cls._args_network_interface_update.ip_configurations.Element.subnet.route_table.routes - routes.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_update.ip_configurations.Element.subnet.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - nullable=True, - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - nullable=True, - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - subnets = cls._args_network_interface_update.ip_configurations.Element.subnet.route_table.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_interface_update.ip_configurations.Element.subnet.route_table.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - network_security_group = cls._args_network_interface_update.network_security_group - network_security_group.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_security_group.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - network_security_group.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - nullable=True, - ) - network_security_group.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - network_security_group.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - network_security_group.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - network_security_group.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - network_security_group.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_network_interface_update.network_security_group.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - network_interfaces = cls._args_network_interface_update.network_security_group.network_interfaces - network_interfaces.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_network_interface_update(network_interfaces.Element) - - security_rules = cls._args_network_interface_update.network_security_group.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(security_rules.Element) - - subnets = cls._args_network_interface_update.network_security_group.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_interface_update.network_security_group.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - tags = cls._args_network_interface_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.dns_settings = cls._args_network_interface_update.dns_settings - _schema.enable_ip_forwarding = cls._args_network_interface_update.enable_ip_forwarding - _schema.etag = cls._args_network_interface_update.etag - _schema.id = cls._args_network_interface_update.id - _schema.ip_configurations = cls._args_network_interface_update.ip_configurations - _schema.location = cls._args_network_interface_update.location - _schema.mac_address = cls._args_network_interface_update.mac_address - _schema.network_security_group = cls._args_network_interface_update.network_security_group - _schema.primary = cls._args_network_interface_update.primary - _schema.provisioning_state = cls._args_network_interface_update.provisioning_state - _schema.resource_guid = cls._args_network_interface_update.resource_guid - _schema.tags = cls._args_network_interface_update.tags - _schema.virtual_machine = cls._args_network_interface_update.virtual_machine - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg( - nullable=True, - ) - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - network_security_group_update.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - nullable=True, - ) - network_security_group_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - network_security_group_update.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_update.network_interfaces - network_interfaces.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_network_interface_update(network_interfaces.Element) - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - - subnets = cls._args_network_security_group_update.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_subnet_update = None - - @classmethod - def _build_args_subnet_update(cls, _schema): - if cls._args_subnet_update is not None: - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - return - - cls._args_subnet_update = AAZObjectArg( - nullable=True, - ) - - subnet_update = cls._args_subnet_update - subnet_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - subnet_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - subnet_update.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - nullable=True, - ) - subnet_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(subnet_update.network_security_group) - subnet_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - nullable=True, - ) - subnet_update.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - nullable=True, - ) - - route_table = cls._args_subnet_update.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - nullable=True, - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - routes = cls._args_subnet_update.route_table.routes - routes.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - nullable=True, - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - nullable=True, - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - subnets = cls._args_subnet_update.route_table.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_subnet_update.route_table.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType) - properties.set_prop("enableIPForwarding", AAZBoolType, ".ip_forwarding") - properties.set_prop("networkSecurityGroup", AAZObjectType, ".nsg") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name") - - dns_servers = _builder.get(".properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - network_security_group = _builder.get(".properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("etag", AAZStrType, ".etag") - network_security_group.set_prop("id", AAZStrType, ".id") - network_security_group.set_prop("location", AAZStrType, ".location") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - network_security_group.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkSecurityGroup.properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.networkSecurityGroup.properties.defaultSecurityRules") - if default_security_rules is not None: - _UpdateHelper._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkSecurityGroup.properties.networkInterfaces") - if network_interfaces is not None: - _UpdateHelper._build_schema_network_interface_update(network_interfaces.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.networkSecurityGroup.properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkSecurityGroup.properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - subnets = _builder.get(".properties.networkSecurityGroup.properties.subnets") - if subnets is not None: - _UpdateHelper._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkSecurityGroup.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_network_interface_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_update(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address") - properties.set_prop("subnet", AAZObjectType, ".subnet") - - load_balancer_backend_address_pools = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - load_balancer_inbound_nat_rules = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_update(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - public_ip_address = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("etag", AAZStrType, ".etag") - public_ip_address.set_prop("id", AAZStrType, ".id") - public_ip_address.set_prop("location", AAZStrType, ".location") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - public_ip_address.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - subnet = _builder.get(".properties.ipConfigurations[].properties.subnet") - if subnet is not None: - subnet.set_prop("etag", AAZStrType, ".etag") - subnet.set_prop("id", AAZStrType, ".id") - subnet.set_prop("name", AAZStrType, ".name") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - route_table = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - network_security_group = _builder.get(".properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("etag", AAZStrType, ".etag") - network_security_group.set_prop("id", AAZStrType, ".id") - network_security_group.set_prop("location", AAZStrType, ".location") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - network_security_group.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkSecurityGroup.properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.networkSecurityGroup.properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkSecurityGroup.properties.networkInterfaces") - if network_interfaces is not None: - cls._build_schema_network_interface_update(network_interfaces.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.networkSecurityGroup.properties.securityRules") - if security_rules is not None: - cls._build_schema_security_rule_update(security_rules.set_elements(AAZObjectType, ".")) - - subnets = _builder.get(".properties.networkSecurityGroup.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkSecurityGroup.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - cls._build_schema_network_interface_update(network_interfaces.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_wait.py deleted file mode 100644 index 269573e0880..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/_wait.py +++ /dev/null @@ -1,753 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/__cmd_group.py deleted file mode 100644 index cede61b5c80..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 nic ip-config", -) -class __CMDGroup(AAZCommandGroup): - """Manage IP configurations of a network interface. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_create.py deleted file mode 100644 index 039848960cd..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_create.py +++ /dev/null @@ -1,2281 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config create", -) -class Create(AAZCommand): - """Create an IP configuration. - - You must have the Microsoft.Network/AllowMultipleIpConfigurationsPerNic feature enabled for your subscription. Only one configuration may be designated as the primary IP configuration per NIC, using the `--make-primary` flag. - - :example: Create a primary IP configuration for a NIC. - az network nic ip-config create -g MyResourceGroup -n MyIpConfig --nic-name MyNic --make-primary - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15", "properties.ipConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the IP configuration.", - required=True, - ) - - # define Arg Group "IP Configuration" - - _args_schema = cls._args_schema - _args_schema.make_primary = AAZBoolArg( - options=["--make-primary"], - arg_group="IP Configuration", - help="Set to make this configuration the primary one for the NIC.", - default=False, - ) - _args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="IP Configuration", - help="Static IP address to use or \"\"('\"\"' in PowerShell) to use a dynamic address.", - ) - _args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="IP Configuration", - help="Name or ID of an existing public IP address.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - _args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="IP Configuration", - help="Name or ID of an existing subnet. If name specified, please also specify `--vnet-name`.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualnetworks/{}/subnets/{}", - ), - ) - - # define Arg Group "Parameters.properties.ipConfigurations[]" - - # define Arg Group "PipObj" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.load_balancer_backend_address_pools = AAZListArg( - options=["--load-balancer-backend-address-pools"], - arg_group="Properties", - help="The reference to LoadBalancerBackendAddressPool resource.", - ) - _args_schema.load_balancer_inbound_nat_rules = AAZListArg( - options=["--load-balancer-inbound-nat-rules"], - arg_group="Properties", - help="A list of references of LoadBalancerInboundNatRules.", - ) - _args_schema.private_ip_allocation_method = AAZStrArg( - options=["--private-ip-allocation-method"], - arg_group="Properties", - help="The private IP address allocation method.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - - load_balancer_backend_address_pools = cls._args_schema.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_schema.load_balancer_backend_address_pools.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resource.", - ) - - load_balancer_inbound_nat_rules = cls._args_schema.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_schema.load_balancer_inbound_nat_rules.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource.", - ) - - # define Arg Group "PublicIPAddress" - - # define Arg Group "Subnet" - - # define Arg Group "SubnetObj" - return cls._args_schema - - _args_network_interface_update = None - - @classmethod - def _build_args_network_interface_update(cls, _schema): - if cls._args_network_interface_update is not None: - _schema.dns_settings = cls._args_network_interface_update.dns_settings - _schema.enable_ip_forwarding = cls._args_network_interface_update.enable_ip_forwarding - _schema.etag = cls._args_network_interface_update.etag - _schema.id = cls._args_network_interface_update.id - _schema.ip_configurations = cls._args_network_interface_update.ip_configurations - _schema.location = cls._args_network_interface_update.location - _schema.mac_address = cls._args_network_interface_update.mac_address - _schema.network_security_group = cls._args_network_interface_update.network_security_group - _schema.primary = cls._args_network_interface_update.primary - _schema.provisioning_state = cls._args_network_interface_update.provisioning_state - _schema.resource_guid = cls._args_network_interface_update.resource_guid - _schema.tags = cls._args_network_interface_update.tags - _schema.virtual_machine = cls._args_network_interface_update.virtual_machine - return - - cls._args_network_interface_update = AAZObjectArg() - - network_interface_update = cls._args_network_interface_update - network_interface_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_interface_update.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - network_interface_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_interface_update.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - ) - network_interface_update.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - ) - network_interface_update.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - ) - network_interface_update.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - ) - network_interface_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - network_interface_update.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - ) - network_interface_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - network_interface_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - ) - network_interface_update.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - ) - cls._build_args_sub_resource_update(network_interface_update.virtual_machine) - network_interface_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_network_interface_update.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - ) - - applied_dns_servers = cls._args_network_interface_update.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg() - - dns_servers = cls._args_network_interface_update.dns_settings.dns_servers - dns_servers.Element = AAZStrArg() - - ip_configurations = cls._args_network_interface_update.ip_configurations - ip_configurations.Element = AAZObjectArg() - - _element = cls._args_network_interface_update.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - ) - _element.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - ) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - ) - _element.private_ip_address = AAZStrArg( - options=["private-ip-address"], - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address resource.", - ) - _element.subnet = AAZObjectArg( - options=["subnet"], - ) - - load_balancer_backend_address_pools = cls._args_network_interface_update.ip_configurations.Element.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_network_interface_update.ip_configurations.Element.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - load_balancer_inbound_nat_rules = cls._args_network_interface_update.ip_configurations.Element.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_network_interface_update.ip_configurations.Element.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_update(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - public_ip_address = cls._args_network_interface_update.ip_configurations.Element.public_ip_address - public_ip_address.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - public_ip_address.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - ) - public_ip_address.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - ) - public_ip_address.ip_address = AAZStrArg( - options=["ip-address"], - ) - public_ip_address.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - public_ip_address.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - ) - public_ip_address.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_network_interface_update.ip_configurations.Element.public_ip_address.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - ) - - tags = cls._args_network_interface_update.ip_configurations.Element.public_ip_address.tags - tags.Element = AAZStrArg() - - subnet = cls._args_network_interface_update.ip_configurations.Element.subnet - subnet.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - subnet.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualnetworks/{}/subnets/{}", - ), - ) - subnet.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - subnet.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - subnet.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_update(subnet.network_security_group) - subnet.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - ) - subnet.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - ) - - route_table = cls._args_network_interface_update.ip_configurations.Element.subnet.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_network_interface_update.ip_configurations.Element.subnet.route_table.routes - routes.Element = AAZObjectArg() - - _element = cls._args_network_interface_update.ip_configurations.Element.subnet.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - subnets = cls._args_network_interface_update.ip_configurations.Element.subnet.route_table.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_interface_update.ip_configurations.Element.subnet.route_table.tags - tags.Element = AAZStrArg() - - network_security_group = cls._args_network_interface_update.network_security_group - network_security_group.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_security_group.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - network_security_group.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - ) - network_security_group.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - network_security_group.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - network_security_group.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - network_security_group.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_network_interface_update.network_security_group.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_update(default_security_rules.Element) - - network_interfaces = cls._args_network_interface_update.network_security_group.network_interfaces - network_interfaces.Element = AAZObjectArg() - cls._build_args_network_interface_update(network_interfaces.Element) - - security_rules = cls._args_network_interface_update.network_security_group.security_rules - security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_update(security_rules.Element) - - subnets = cls._args_network_interface_update.network_security_group.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_interface_update.network_security_group.tags - tags.Element = AAZStrArg() - - tags = cls._args_network_interface_update.tags - tags.Element = AAZStrArg() - - _schema.dns_settings = cls._args_network_interface_update.dns_settings - _schema.enable_ip_forwarding = cls._args_network_interface_update.enable_ip_forwarding - _schema.etag = cls._args_network_interface_update.etag - _schema.id = cls._args_network_interface_update.id - _schema.ip_configurations = cls._args_network_interface_update.ip_configurations - _schema.location = cls._args_network_interface_update.location - _schema.mac_address = cls._args_network_interface_update.mac_address - _schema.network_security_group = cls._args_network_interface_update.network_security_group - _schema.primary = cls._args_network_interface_update.primary - _schema.provisioning_state = cls._args_network_interface_update.provisioning_state - _schema.resource_guid = cls._args_network_interface_update.resource_guid - _schema.tags = cls._args_network_interface_update.tags - _schema.virtual_machine = cls._args_network_interface_update.virtual_machine - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg() - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - network_security_group_update.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - ) - network_security_group_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group_update.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_update(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_update.network_interfaces - network_interfaces.Element = AAZObjectArg() - cls._build_args_network_interface_update(network_interfaces.Element) - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg() - - _element = cls._args_network_security_group_update.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - - subnets = cls._args_network_security_group_update.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg() - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - return - - cls._args_security_rule_update = AAZObjectArg() - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg() - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_subnet_update = None - - @classmethod - def _build_args_subnet_update(cls, _schema): - if cls._args_subnet_update is not None: - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - return - - cls._args_subnet_update = AAZObjectArg() - - subnet_update = cls._args_subnet_update - subnet_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - subnet_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - subnet_update.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - subnet_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_update(subnet_update.network_security_group) - subnet_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - ) - subnet_update.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - ) - - route_table = cls._args_subnet_update.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_subnet_update.route_table.routes - routes.Element = AAZObjectArg() - - _element = cls._args_subnet_update.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - subnets = cls._args_subnet_update.route_table.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_subnet_update.route_table.tags - tags.Element = AAZStrArg() - - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".make_primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType) - properties.set_prop("subnet", AAZObjectType) - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - public_ip_address = _builder.get(".properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".public_ip_address") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - subnet = _builder.get(".properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_network_interface_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_update(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address") - properties.set_prop("subnet", AAZObjectType, ".subnet") - - load_balancer_backend_address_pools = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - load_balancer_inbound_nat_rules = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_update(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - public_ip_address = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("etag", AAZStrType, ".etag") - public_ip_address.set_prop("id", AAZStrType, ".id") - public_ip_address.set_prop("location", AAZStrType, ".location") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - public_ip_address.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - subnet = _builder.get(".properties.ipConfigurations[].properties.subnet") - if subnet is not None: - subnet.set_prop("etag", AAZStrType, ".etag") - subnet.set_prop("id", AAZStrType, ".id") - subnet.set_prop("name", AAZStrType, ".name") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - route_table = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - network_security_group = _builder.get(".properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("etag", AAZStrType, ".etag") - network_security_group.set_prop("id", AAZStrType, ".id") - network_security_group.set_prop("location", AAZStrType, ".location") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - network_security_group.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkSecurityGroup.properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.networkSecurityGroup.properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkSecurityGroup.properties.networkInterfaces") - if network_interfaces is not None: - cls._build_schema_network_interface_update(network_interfaces.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.networkSecurityGroup.properties.securityRules") - if security_rules is not None: - cls._build_schema_security_rule_update(security_rules.set_elements(AAZObjectType, ".")) - - subnets = _builder.get(".properties.networkSecurityGroup.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkSecurityGroup.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - cls._build_schema_network_interface_update(network_interfaces.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_delete.py deleted file mode 100644 index 4b8543cc77c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_delete.py +++ /dev/null @@ -1,907 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config delete", -) -class Delete(AAZCommand): - """Delete an IP configuration. - - An NIC must have at least one IP configuration. - - :example: Delete an IP configuration. - az network nic ip-config delete -g MyResourceGroup -n MyIpConfig --nic-name MyNic - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15", "properties.ipConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the IP configuration.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_list.py deleted file mode 100644 index 7a934765bc0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_list.py +++ /dev/null @@ -1,761 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config list", -) -class List(AAZCommand): - """List the IP configurations of an NIC. - - :example: List the IP configurations of an NIC. - az network nic ip-config list -g MyResourceGroup --nic-name MyNic - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15", "properties.ipConfigurations"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.ipConfigurations - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.ipConfigurations = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_show.py deleted file mode 100644 index 17cbe7332ca..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_show.py +++ /dev/null @@ -1,780 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config show", -) -class Show(AAZCommand): - """Show the details of an IP configuration. - - :example: Show the details of an IP configuration of an NIC. - az network nic ip-config show -g MyResourceGroup -n MyIpConfig --nic-name MyNic - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15", "properties.ipConfigurations[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the IP configuration.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_update.py deleted file mode 100644 index c7a348a9abe..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_update.py +++ /dev/null @@ -1,2494 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config update", -) -class Update(AAZCommand): - """Update an IP configuration. - - :example: Update a NIC to use a new private IP address. - az network nic ip-config update -g MyResourceGroup --nic-name MyNic -n MyIpConfig --private-ip-address 10.0.0.9 - - :example: Make an IP configuration the default for the supplied NIC. - az network nic ip-config update -g MyResourceGroup --nic-name MyNic -n MyIpConfig --make-primary - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15", "properties.ipConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the IP configuration.", - required=True, - ) - - # define Arg Group "IP Configuration" - - _args_schema = cls._args_schema - _args_schema.make_primary = AAZBoolArg( - options=["--make-primary"], - arg_group="IP Configuration", - help="Set to make this configuration the primary one for the NIC.", - nullable=True, - ) - _args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="IP Configuration", - help="Static IP address to use or \"\"('\"\"' in PowerShell) to use a dynamic address.", - nullable=True, - ) - _args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="IP Configuration", - help="Name or ID of an existing public IP address.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - _args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="IP Configuration", - help="Name or ID of an existing subnet. If name specified, please also specify `--vnet-name`.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualnetworks/{}/subnets/{}", - ), - ) - - # define Arg Group "Parameters.properties.ipConfigurations[]" - - # define Arg Group "PipObj" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.load_balancer_backend_address_pools = AAZListArg( - options=["--load-balancer-backend-address-pools"], - arg_group="Properties", - help="The reference to LoadBalancerBackendAddressPool resource.", - nullable=True, - ) - _args_schema.load_balancer_inbound_nat_rules = AAZListArg( - options=["--load-balancer-inbound-nat-rules"], - arg_group="Properties", - help="A list of references of LoadBalancerInboundNatRules.", - nullable=True, - ) - _args_schema.private_ip_allocation_method = AAZStrArg( - options=["--private-ip-allocation-method"], - arg_group="Properties", - help="The private IP address allocation method.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - - load_balancer_backend_address_pools = cls._args_schema.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.load_balancer_backend_address_pools.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resource.", - nullable=True, - ) - - load_balancer_inbound_nat_rules = cls._args_schema.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.load_balancer_inbound_nat_rules.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource.", - nullable=True, - ) - - # define Arg Group "PublicIPAddress" - - # define Arg Group "Subnet" - - # define Arg Group "SubnetObj" - return cls._args_schema - - _args_network_interface_update = None - - @classmethod - def _build_args_network_interface_update(cls, _schema): - if cls._args_network_interface_update is not None: - _schema.dns_settings = cls._args_network_interface_update.dns_settings - _schema.enable_ip_forwarding = cls._args_network_interface_update.enable_ip_forwarding - _schema.etag = cls._args_network_interface_update.etag - _schema.id = cls._args_network_interface_update.id - _schema.ip_configurations = cls._args_network_interface_update.ip_configurations - _schema.location = cls._args_network_interface_update.location - _schema.mac_address = cls._args_network_interface_update.mac_address - _schema.network_security_group = cls._args_network_interface_update.network_security_group - _schema.primary = cls._args_network_interface_update.primary - _schema.provisioning_state = cls._args_network_interface_update.provisioning_state - _schema.resource_guid = cls._args_network_interface_update.resource_guid - _schema.tags = cls._args_network_interface_update.tags - _schema.virtual_machine = cls._args_network_interface_update.virtual_machine - return - - cls._args_network_interface_update = AAZObjectArg( - nullable=True, - ) - - network_interface_update = cls._args_network_interface_update - network_interface_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_interface_update.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - network_interface_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_interface_update.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - nullable=True, - ) - network_interface_update.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - nullable=True, - ) - network_interface_update.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - nullable=True, - ) - network_interface_update.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - nullable=True, - ) - network_interface_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - network_interface_update.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - nullable=True, - ) - network_interface_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - network_interface_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - nullable=True, - ) - network_interface_update.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - nullable=True, - ) - cls._build_args_sub_resource_update(network_interface_update.virtual_machine) - network_interface_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_network_interface_update.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - nullable=True, - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - nullable=True, - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - nullable=True, - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - nullable=True, - ) - - applied_dns_servers = cls._args_network_interface_update.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg( - nullable=True, - ) - - dns_servers = cls._args_network_interface_update.dns_settings.dns_servers - dns_servers.Element = AAZStrArg( - nullable=True, - ) - - ip_configurations = cls._args_network_interface_update.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_update.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - nullable=True, - ) - _element.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - nullable=True, - ) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - nullable=True, - ) - _element.private_ip_address = AAZStrArg( - options=["private-ip-address"], - nullable=True, - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - nullable=True, - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address resource.", - nullable=True, - ) - _element.subnet = AAZObjectArg( - options=["subnet"], - nullable=True, - ) - - load_balancer_backend_address_pools = cls._args_network_interface_update.ip_configurations.Element.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_update.ip_configurations.Element.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - load_balancer_inbound_nat_rules = cls._args_network_interface_update.ip_configurations.Element.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_update.ip_configurations.Element.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - nullable=True, - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - nullable=True, - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - nullable=True, - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - public_ip_address = cls._args_network_interface_update.ip_configurations.Element.public_ip_address - public_ip_address.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - public_ip_address.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - nullable=True, - ) - public_ip_address.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - nullable=True, - ) - public_ip_address.ip_address = AAZStrArg( - options=["ip-address"], - nullable=True, - ) - public_ip_address.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - public_ip_address.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - nullable=True, - ) - public_ip_address.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_network_interface_update.ip_configurations.Element.public_ip_address.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - nullable=True, - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - nullable=True, - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - nullable=True, - ) - - tags = cls._args_network_interface_update.ip_configurations.Element.public_ip_address.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - subnet = cls._args_network_interface_update.ip_configurations.Element.subnet - subnet.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - subnet.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualnetworks/{}/subnets/{}", - ), - ) - subnet.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - subnet.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - nullable=True, - ) - subnet.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(subnet.network_security_group) - subnet.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - nullable=True, - ) - subnet.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - nullable=True, - ) - - route_table = cls._args_network_interface_update.ip_configurations.Element.subnet.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - nullable=True, - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - routes = cls._args_network_interface_update.ip_configurations.Element.subnet.route_table.routes - routes.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_update.ip_configurations.Element.subnet.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - nullable=True, - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - nullable=True, - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - subnets = cls._args_network_interface_update.ip_configurations.Element.subnet.route_table.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_interface_update.ip_configurations.Element.subnet.route_table.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - network_security_group = cls._args_network_interface_update.network_security_group - network_security_group.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_security_group.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - network_security_group.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - nullable=True, - ) - network_security_group.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - network_security_group.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - network_security_group.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - network_security_group.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - network_security_group.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_network_interface_update.network_security_group.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - network_interfaces = cls._args_network_interface_update.network_security_group.network_interfaces - network_interfaces.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_network_interface_update(network_interfaces.Element) - - security_rules = cls._args_network_interface_update.network_security_group.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(security_rules.Element) - - subnets = cls._args_network_interface_update.network_security_group.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_interface_update.network_security_group.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - tags = cls._args_network_interface_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.dns_settings = cls._args_network_interface_update.dns_settings - _schema.enable_ip_forwarding = cls._args_network_interface_update.enable_ip_forwarding - _schema.etag = cls._args_network_interface_update.etag - _schema.id = cls._args_network_interface_update.id - _schema.ip_configurations = cls._args_network_interface_update.ip_configurations - _schema.location = cls._args_network_interface_update.location - _schema.mac_address = cls._args_network_interface_update.mac_address - _schema.network_security_group = cls._args_network_interface_update.network_security_group - _schema.primary = cls._args_network_interface_update.primary - _schema.provisioning_state = cls._args_network_interface_update.provisioning_state - _schema.resource_guid = cls._args_network_interface_update.resource_guid - _schema.tags = cls._args_network_interface_update.tags - _schema.virtual_machine = cls._args_network_interface_update.virtual_machine - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg( - nullable=True, - ) - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - network_security_group_update.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - nullable=True, - ) - network_security_group_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - network_security_group_update.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_update.network_interfaces - network_interfaces.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_network_interface_update(network_interfaces.Element) - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - - subnets = cls._args_network_security_group_update.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_subnet_update = None - - @classmethod - def _build_args_subnet_update(cls, _schema): - if cls._args_subnet_update is not None: - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - return - - cls._args_subnet_update = AAZObjectArg( - nullable=True, - ) - - subnet_update = cls._args_subnet_update - subnet_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - subnet_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - subnet_update.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - nullable=True, - ) - subnet_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(subnet_update.network_security_group) - subnet_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - nullable=True, - ) - subnet_update.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - nullable=True, - ) - - route_table = cls._args_subnet_update.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - nullable=True, - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - routes = cls._args_subnet_update.route_table.routes - routes.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - nullable=True, - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - nullable=True, - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - subnets = cls._args_subnet_update.route_table.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_subnet_update.route_table.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".make_primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType) - properties.set_prop("subnet", AAZObjectType) - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - public_ip_address = _builder.get(".properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".public_ip_address") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - subnet = _builder.get(".properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_network_interface_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_update(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address") - properties.set_prop("subnet", AAZObjectType, ".subnet") - - load_balancer_backend_address_pools = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - load_balancer_inbound_nat_rules = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_update(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - public_ip_address = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("etag", AAZStrType, ".etag") - public_ip_address.set_prop("id", AAZStrType, ".id") - public_ip_address.set_prop("location", AAZStrType, ".location") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - public_ip_address.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - subnet = _builder.get(".properties.ipConfigurations[].properties.subnet") - if subnet is not None: - subnet.set_prop("etag", AAZStrType, ".etag") - subnet.set_prop("id", AAZStrType, ".id") - subnet.set_prop("name", AAZStrType, ".name") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - route_table = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - network_security_group = _builder.get(".properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("etag", AAZStrType, ".etag") - network_security_group.set_prop("id", AAZStrType, ".id") - network_security_group.set_prop("location", AAZStrType, ".location") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - network_security_group.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkSecurityGroup.properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.networkSecurityGroup.properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkSecurityGroup.properties.networkInterfaces") - if network_interfaces is not None: - cls._build_schema_network_interface_update(network_interfaces.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.networkSecurityGroup.properties.securityRules") - if security_rules is not None: - cls._build_schema_security_rule_update(security_rules.set_elements(AAZObjectType, ".")) - - subnets = _builder.get(".properties.networkSecurityGroup.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkSecurityGroup.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - cls._build_schema_network_interface_update(network_interfaces.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_wait.py deleted file mode 100644 index 2ca80601e07..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/_wait.py +++ /dev/null @@ -1,746 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15", "properties.ipConfigurations[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/inbound_nat_rule/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/inbound_nat_rule/__cmd_group.py deleted file mode 100644 index 0ad92b74449..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/inbound_nat_rule/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 nic ip-config inbound-nat-rule", -) -class __CMDGroup(AAZCommandGroup): - """Manage inbound NAT rules of an IP configuration. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/inbound_nat_rule/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/inbound_nat_rule/__init__.py deleted file mode 100644 index 7767ee77098..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/inbound_nat_rule/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._add import * -from ._remove import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/inbound_nat_rule/_add.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/inbound_nat_rule/_add.py deleted file mode 100644 index 8fa0328e590..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/inbound_nat_rule/_add.py +++ /dev/null @@ -1,968 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config inbound-nat-rule add", -) -class Add(AAZCommand): - """Add an inbound NAT rule to an IP configuration. - - :example: Add an inbound NAT rule to an IP configuration. - az network nic ip-config inbound-nat-rule add -g MyResourceGroup --nic-name MyNic -n MyIpConfig --inbound-nat-rule MyNatRule - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15", "properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.inbound_nat_rule = AAZStrArg( - options=["--inbound-nat-rule"], - help="Name or ID of an existing inbound NAT rule. If name is used, `--lb-name` must be specified.", - required=True, - ) - - # define Arg Group "Parameters.properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]" - - # define Arg Group "Properties" - return cls._args_schema - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg() - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - - _schema.id = cls._args_sub_resource_update.id - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerInboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.inbound_nat_rule, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerInboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.inbound_nat_rule, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("id", AAZStrType, ".inbound_nat_rule") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - -class _AddHelper: - """Helper class for Add""" - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Add"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/inbound_nat_rule/_remove.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/inbound_nat_rule/_remove.py deleted file mode 100644 index 0aceaac7bd2..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/inbound_nat_rule/_remove.py +++ /dev/null @@ -1,926 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config inbound-nat-rule remove", -) -class Remove(AAZCommand): - """Remove an inbound NAT rule of an IP configuration. - - :example: Remove an inbound NAT rule of an IP configuration. - az network nic ip-config inbound-nat-rule remove -g MyResourceGroup --nic-name MyNic -n MyIpConfig --inbound-nat-rule MyNatRule - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15", "properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.inbound_nat_rule = AAZStrArg( - options=["--inbound-nat-rule"], - help="Resource ID.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerInboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.inbound_nat_rule, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerInboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.inbound_nat_rule, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _RemoveHelper: - """Helper class for Remove""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Remove"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/inbound_nat_rule/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/inbound_nat_rule/_wait.py deleted file mode 100644 index d6a7f2b4588..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/inbound_nat_rule/_wait.py +++ /dev/null @@ -1,746 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config inbound-nat-rule wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15", "properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/lb_pool/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/lb_pool/__cmd_group.py deleted file mode 100644 index 265bf5a2e1b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/lb_pool/__cmd_group.py +++ /dev/null @@ -1,20 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class __CMDGroup(AAZCommandGroup): - """Manage address pools in an IP configuration. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/lb_pool/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/lb_pool/__init__.py deleted file mode 100644 index 0b07bb6fd96..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/lb_pool/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._add import * -from ._remove import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/lb_pool/_add.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/lb_pool/_add.py deleted file mode 100644 index af5022a4ba9..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/lb_pool/_add.py +++ /dev/null @@ -1,938 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Add(AAZCommand): - """Add an address pool to an IP configuration. - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15", "properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.pool_id = AAZStrArg( - options=["--pool-id"], - help="Resource ID.", - required=True, - ) - - # define Arg Group "Parameters.properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]" - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("id", AAZStrType, ".pool_id") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - -class _AddHelper: - """Helper class for Add""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Add"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/lb_pool/_remove.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/lb_pool/_remove.py deleted file mode 100644 index b92988b833d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nic/ip_config/lb_pool/_remove.py +++ /dev/null @@ -1,920 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Remove(AAZCommand): - """Remove an address pool of an IP configuration. - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2015-06-15", "properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.pool_id = AAZStrArg( - options=["--pool-id"], - help="Resource ID.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _RemoveHelper: - """Helper class for Remove""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Remove"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/__cmd_group.py deleted file mode 100644 index 581b4fd303c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 nsg", -) -class __CMDGroup(AAZCommandGroup): - """Manage Azure Network Security Groups (NSGs). - - You can control network traffic to resources in a virtual network using a network security group. A network security group contains a list of security rules that allow or deny inbound or outbound network traffic based on source or destination IP addresses, Application Security Groups, ports, and protocols. For more information visit https://learn.microsoft.com/azure/virtual-network/virtual-networks-create-nsg-arm-cli. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_create.py deleted file mode 100644 index 349adfe1808..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_create.py +++ /dev/null @@ -1,1885 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg create", -) -class Create(AAZCommand): - """Create a network security group. - - :example: Create an NSG in a resource group within a region with tags. - az network nsg create -g MyResourceGroup -n MyNsg --tags foo=bar - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - return cls._args_schema - - _args_ip_configuration_create = None - - @classmethod - def _build_args_ip_configuration_create(cls, _schema): - if cls._args_ip_configuration_create is not None: - _schema.etag = cls._args_ip_configuration_create.etag - _schema.id = cls._args_ip_configuration_create.id - _schema.name = cls._args_ip_configuration_create.name - _schema.private_ip_address = cls._args_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_create.private_ip_allocation_method - _schema.provisioning_state = cls._args_ip_configuration_create.provisioning_state - _schema.public_ip_address = cls._args_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_ip_configuration_create.subnet - return - - cls._args_ip_configuration_create = AAZObjectArg() - - ip_configuration_create = cls._args_ip_configuration_create - ip_configuration_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - ip_configuration_create.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - ip_configuration_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - ip_configuration_create.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="The private IP address of the IP configuration.", - ) - ip_configuration_create.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP allocation method. Possible values are 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - ip_configuration_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - ip_configuration_create.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference of the public IP resource.", - ) - cls._build_args_public_ip_address_create(ip_configuration_create.public_ip_address) - ip_configuration_create.subnet = AAZObjectArg( - options=["subnet"], - help="The reference of the subnet resource.", - ) - cls._build_args_subnet_create(ip_configuration_create.subnet) - - _schema.etag = cls._args_ip_configuration_create.etag - _schema.id = cls._args_ip_configuration_create.id - _schema.name = cls._args_ip_configuration_create.name - _schema.private_ip_address = cls._args_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_create.private_ip_allocation_method - _schema.provisioning_state = cls._args_ip_configuration_create.provisioning_state - _schema.public_ip_address = cls._args_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_ip_configuration_create.subnet - - _args_network_interface_ip_configuration_create = None - - @classmethod - def _build_args_network_interface_ip_configuration_create(cls, _schema): - if cls._args_network_interface_ip_configuration_create is not None: - _schema.etag = cls._args_network_interface_ip_configuration_create.etag - _schema.id = cls._args_network_interface_ip_configuration_create.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_create.name - _schema.primary = cls._args_network_interface_ip_configuration_create.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_create.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_create.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_create.subnet - return - - cls._args_network_interface_ip_configuration_create = AAZObjectArg() - - network_interface_ip_configuration_create = cls._args_network_interface_ip_configuration_create - network_interface_ip_configuration_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_interface_ip_configuration_create.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - network_interface_ip_configuration_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - network_interface_ip_configuration_create.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - ) - network_interface_ip_configuration_create.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - ) - network_interface_ip_configuration_create.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - ) - network_interface_ip_configuration_create.private_ip_address = AAZStrArg( - options=["private-ip-address"], - ) - network_interface_ip_configuration_create.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - network_interface_ip_configuration_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - ) - network_interface_ip_configuration_create.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - ) - cls._build_args_public_ip_address_create(network_interface_ip_configuration_create.public_ip_address) - network_interface_ip_configuration_create.subnet = AAZObjectArg( - options=["subnet"], - help="Subnet in a virtual network resource.", - ) - cls._build_args_subnet_create(network_interface_ip_configuration_create.subnet) - - load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.backend_ip_configurations = AAZListArg( - options=["backend-ip-configurations"], - help="Gets collection of references to IP addresses defined in network interfaces.", - ) - _element.outbound_nat_rule = AAZObjectArg( - options=["outbound-nat-rule"], - help="Gets outbound rules that use this backend address pool.", - ) - cls._build_args_sub_resource_create(_element.outbound_nat_rule) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - backend_ip_configurations = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools.Element.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectArg() - cls._build_args_network_interface_ip_configuration_create(backend_ip_configurations.Element) - - load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.backend_ip_configuration = AAZObjectArg( - options=["backend-ip-configuration"], - help="A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backed IP.", - ) - cls._build_args_network_interface_ip_configuration_create(_element.backend_ip_configuration) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - _schema.etag = cls._args_network_interface_ip_configuration_create.etag - _schema.id = cls._args_network_interface_ip_configuration_create.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_create.name - _schema.primary = cls._args_network_interface_ip_configuration_create.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_create.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_create.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_create.subnet - - _args_network_security_group_create = None - - @classmethod - def _build_args_network_security_group_create(cls, _schema): - if cls._args_network_security_group_create is not None: - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.id = cls._args_network_security_group_create.id - _schema.location = cls._args_network_security_group_create.location - _schema.network_interfaces = cls._args_network_security_group_create.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_create.provisioning_state - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.subnets = cls._args_network_security_group_create.subnets - _schema.tags = cls._args_network_security_group_create.tags - return - - cls._args_network_security_group_create = AAZObjectArg() - - network_security_group_create = cls._args_network_security_group_create - network_security_group_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_create.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - network_security_group_create.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - ) - network_security_group_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - network_security_group_create.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - network_security_group_create.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group_create.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - network_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_network_security_group_create.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_create(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_create.network_interfaces - network_interfaces.Element = AAZObjectArg() - - _element = cls._args_network_security_group_create.network_interfaces.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - ) - _element.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - ) - _element.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - ) - _element.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - ) - _element.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_create(_element.network_security_group) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - ) - _element.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - ) - cls._build_args_sub_resource_create(_element.virtual_machine) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_network_security_group_create.network_interfaces.Element.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - ) - - applied_dns_servers = cls._args_network_security_group_create.network_interfaces.Element.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg() - - dns_servers = cls._args_network_security_group_create.network_interfaces.Element.dns_settings.dns_servers - dns_servers.Element = AAZStrArg() - - ip_configurations = cls._args_network_security_group_create.network_interfaces.Element.ip_configurations - ip_configurations.Element = AAZObjectArg() - cls._build_args_network_interface_ip_configuration_create(ip_configurations.Element) - - tags = cls._args_network_security_group_create.network_interfaces.Element.tags - tags.Element = AAZStrArg() - - security_rules = cls._args_network_security_group_create.security_rules - security_rules.Element = AAZObjectArg() - - _element = cls._args_network_security_group_create.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - - subnets = cls._args_network_security_group_create.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_create(subnets.Element) - - tags = cls._args_network_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.id = cls._args_network_security_group_create.id - _schema.location = cls._args_network_security_group_create.location - _schema.network_interfaces = cls._args_network_security_group_create.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_create.provisioning_state - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.subnets = cls._args_network_security_group_create.subnets - _schema.tags = cls._args_network_security_group_create.tags - - _args_public_ip_address_create = None - - @classmethod - def _build_args_public_ip_address_create(cls, _schema): - if cls._args_public_ip_address_create is not None: - _schema.dns_settings = cls._args_public_ip_address_create.dns_settings - _schema.etag = cls._args_public_ip_address_create.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_create.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_create.ip_address - _schema.ip_configuration = cls._args_public_ip_address_create.ip_configuration - _schema.location = cls._args_public_ip_address_create.location - _schema.provisioning_state = cls._args_public_ip_address_create.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_create.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_create.resource_guid - _schema.tags = cls._args_public_ip_address_create.tags - return - - cls._args_public_ip_address_create = AAZObjectArg() - - public_ip_address_create = cls._args_public_ip_address_create - public_ip_address_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - public_ip_address_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_create.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - ) - public_ip_address_create.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - ) - public_ip_address_create.ip_address = AAZStrArg( - options=["ip-address"], - ) - public_ip_address_create.ip_configuration = AAZObjectArg( - options=["ip-configuration"], - ) - cls._build_args_ip_configuration_create(public_ip_address_create.ip_configuration) - public_ip_address_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - public_ip_address_create.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_create.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - ) - public_ip_address_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_public_ip_address_create.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - ) - - tags = cls._args_public_ip_address_create.tags - tags.Element = AAZStrArg() - - _schema.dns_settings = cls._args_public_ip_address_create.dns_settings - _schema.etag = cls._args_public_ip_address_create.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_create.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_create.ip_address - _schema.ip_configuration = cls._args_public_ip_address_create.ip_configuration - _schema.location = cls._args_public_ip_address_create.location - _schema.provisioning_state = cls._args_public_ip_address_create.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_create.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_create.resource_guid - _schema.tags = cls._args_public_ip_address_create.tags - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_port_range = cls._args_security_rule_create.source_port_range - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_port_range = cls._args_security_rule_create.source_port_range - - _args_sub_resource_create = None - - @classmethod - def _build_args_sub_resource_create(cls, _schema): - if cls._args_sub_resource_create is not None: - _schema.id = cls._args_sub_resource_create.id - return - - cls._args_sub_resource_create = AAZObjectArg() - - sub_resource_create = cls._args_sub_resource_create - sub_resource_create.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - - _schema.id = cls._args_sub_resource_create.id - - _args_subnet_create = None - - @classmethod - def _build_args_subnet_create(cls, _schema): - if cls._args_subnet_create is not None: - _schema.address_prefix = cls._args_subnet_create.address_prefix - _schema.etag = cls._args_subnet_create.etag - _schema.ip_configurations = cls._args_subnet_create.ip_configurations - _schema.name = cls._args_subnet_create.name - _schema.network_security_group = cls._args_subnet_create.network_security_group - _schema.provisioning_state = cls._args_subnet_create.provisioning_state - _schema.route_table = cls._args_subnet_create.route_table - return - - cls._args_subnet_create = AAZObjectArg() - - subnet_create = cls._args_subnet_create - subnet_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - subnet_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - subnet_create.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - subnet_create.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="Gets an array of references to the network interface IP configurations using subnet.", - ) - subnet_create.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_create(subnet_create.network_security_group) - subnet_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - ) - subnet_create.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - ) - - ip_configurations = cls._args_subnet_create.ip_configurations - ip_configurations.Element = AAZObjectArg() - cls._build_args_ip_configuration_create(ip_configurations.Element) - - route_table = cls._args_subnet_create.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_subnet_create.route_table.routes - routes.Element = AAZObjectArg() - - _element = cls._args_subnet_create.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - subnets = cls._args_subnet_create.route_table.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_create(subnets.Element) - - tags = cls._args_subnet_create.route_table.tags - tags.Element = AAZStrArg() - - _schema.address_prefix = cls._args_subnet_create.address_prefix - _schema.etag = cls._args_subnet_create.etag - _schema.ip_configurations = cls._args_subnet_create.ip_configurations - _schema.name = cls._args_subnet_create.name - _schema.network_security_group = cls._args_subnet_create.network_security_group - _schema.provisioning_state = cls._args_subnet_create.provisioning_state - _schema.route_table = cls._args_subnet_create.route_table - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkSecurityGroupsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkSecurityGroupsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_network_security_group_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_ip_configuration_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_create(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_create(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - @classmethod - def _build_schema_network_interface_ip_configuration_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_create(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_create(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("backendIPConfigurations", AAZListType, ".backend_ip_configurations") - cls._build_schema_sub_resource_create(properties.set_prop("outboundNatRule", AAZObjectType, ".outbound_nat_rule")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - backend_ip_configurations = _builder.get(".properties.loadBalancerBackendAddressPools[].properties.backendIPConfigurations") - if backend_ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_create(backend_ip_configurations.set_elements(AAZObjectType, ".")) - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - cls._build_schema_network_interface_ip_configuration_create(properties.set_prop("backendIPConfiguration", AAZObjectType, ".backend_ip_configuration")) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_network_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_create(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - network_interfaces.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkInterfaces[].properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - cls._build_schema_network_security_group_create(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_create(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.networkInterfaces[].properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_create(ip_configurations.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkInterfaces[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_create(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - cls._build_schema_ip_configuration_create(properties.set_prop("ipConfiguration", AAZObjectType, ".ip_configuration")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - cls._build_schema_network_security_group_create(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_ip_configuration_create(ip_configurations.set_elements(AAZObjectType, ".")) - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_create(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_delete.py deleted file mode 100644 index bcf4877aa04..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg delete", -) -class Delete(AAZCommand): - """Delete a network security group. - - :example: Delete an NSG in a resource group. - az network nsg delete -g MyResourceGroup -n MyNsg - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkSecurityGroupsDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class NetworkSecurityGroupsDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_list.py deleted file mode 100644 index 4ed10e80224..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_list.py +++ /dev/null @@ -1,810 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg list", -) -class List(AAZCommand): - """List network security groups. - - :example: List all NSGs in the 'westus' region. - az network nsg list --query "[?location=='westus']" - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/networksecuritygroups", "2015-06-15"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.NetworkSecurityGroupsList(ctx=self.ctx)() - if condition_1: - self.NetworkSecurityGroupsListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class NetworkSecurityGroupsList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_network_security_group_read(value.Element) - - return cls._schema_on_200 - - class NetworkSecurityGroupsListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_network_security_group_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_show.py deleted file mode 100644 index 8d1bbac3548..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_show.py +++ /dev/null @@ -1,736 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg show", -) -class Show(AAZCommand): - """Get information about a network security group. - - :example: Get basic information about an NSG. - az network nsg show -g MyResourceGroup -n MyNsg - - :example: Get the default security rules of an NSG and format the output as a table. - az network nsg show -g MyResourceGroup -n MyNsg --query "defaultSecurityRules[]" -o table - - :example: Get all default NSG rules with "Allow" access and format the output as a table. - az network nsg show -g MyResourceGroup -n MyNsg --query "defaultSecurityRules[?access=='Allow']" -o table - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkSecurityGroupsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkSecurityGroupsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_network_security_group_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_update.py deleted file mode 100644 index f480d6d0f7f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_update.py +++ /dev/null @@ -1,2079 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg update", -) -class Update(AAZCommand): - """Update a network security group. - - This command can only be used to update the tags of an NSG. Name and resource group are immutable and cannot be updated. - - :example: Remove a tag of an NSG. - az network nsg update -g MyResourceGroup -n MyNsg --remove tags.no_80 - - :example: Update a network security group. (autogenerated) - az network nsg update --name MyNsg --resource-group MyResourceGroup --set tags.CostCenter=MyBusinessGroup - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - return cls._args_schema - - _args_ip_configuration_update = None - - @classmethod - def _build_args_ip_configuration_update(cls, _schema): - if cls._args_ip_configuration_update is not None: - _schema.etag = cls._args_ip_configuration_update.etag - _schema.id = cls._args_ip_configuration_update.id - _schema.name = cls._args_ip_configuration_update.name - _schema.private_ip_address = cls._args_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_update.private_ip_allocation_method - _schema.provisioning_state = cls._args_ip_configuration_update.provisioning_state - _schema.public_ip_address = cls._args_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_ip_configuration_update.subnet - return - - cls._args_ip_configuration_update = AAZObjectArg( - nullable=True, - ) - - ip_configuration_update = cls._args_ip_configuration_update - ip_configuration_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - ip_configuration_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - ip_configuration_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - ip_configuration_update.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="The private IP address of the IP configuration.", - nullable=True, - ) - ip_configuration_update.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP allocation method. Possible values are 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - ip_configuration_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - ip_configuration_update.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference of the public IP resource.", - nullable=True, - ) - cls._build_args_public_ip_address_update(ip_configuration_update.public_ip_address) - ip_configuration_update.subnet = AAZObjectArg( - options=["subnet"], - help="The reference of the subnet resource.", - nullable=True, - ) - cls._build_args_subnet_update(ip_configuration_update.subnet) - - _schema.etag = cls._args_ip_configuration_update.etag - _schema.id = cls._args_ip_configuration_update.id - _schema.name = cls._args_ip_configuration_update.name - _schema.private_ip_address = cls._args_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_update.private_ip_allocation_method - _schema.provisioning_state = cls._args_ip_configuration_update.provisioning_state - _schema.public_ip_address = cls._args_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_ip_configuration_update.subnet - - _args_network_interface_ip_configuration_update = None - - @classmethod - def _build_args_network_interface_ip_configuration_update(cls, _schema): - if cls._args_network_interface_ip_configuration_update is not None: - _schema.etag = cls._args_network_interface_ip_configuration_update.etag - _schema.id = cls._args_network_interface_ip_configuration_update.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_update.name - _schema.primary = cls._args_network_interface_ip_configuration_update.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_update.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_update.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_update.subnet - return - - cls._args_network_interface_ip_configuration_update = AAZObjectArg( - nullable=True, - ) - - network_interface_ip_configuration_update = cls._args_network_interface_ip_configuration_update - network_interface_ip_configuration_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_interface_ip_configuration_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - network_interface_ip_configuration_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - network_interface_ip_configuration_update.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - nullable=True, - ) - network_interface_ip_configuration_update.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - nullable=True, - ) - network_interface_ip_configuration_update.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - nullable=True, - ) - network_interface_ip_configuration_update.private_ip_address = AAZStrArg( - options=["private-ip-address"], - nullable=True, - ) - network_interface_ip_configuration_update.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - network_interface_ip_configuration_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - nullable=True, - ) - network_interface_ip_configuration_update.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - nullable=True, - ) - cls._build_args_public_ip_address_update(network_interface_ip_configuration_update.public_ip_address) - network_interface_ip_configuration_update.subnet = AAZObjectArg( - options=["subnet"], - help="Subnet in a virtual network resource.", - nullable=True, - ) - cls._build_args_subnet_update(network_interface_ip_configuration_update.subnet) - - load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.backend_ip_configurations = AAZListArg( - options=["backend-ip-configurations"], - help="Gets collection of references to IP addresses defined in network interfaces.", - nullable=True, - ) - _element.outbound_nat_rule = AAZObjectArg( - options=["outbound-nat-rule"], - help="Gets outbound rules that use this backend address pool.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.outbound_nat_rule) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - backend_ip_configurations = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools.Element.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_network_interface_ip_configuration_update(backend_ip_configurations.Element) - - load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.backend_ip_configuration = AAZObjectArg( - options=["backend-ip-configuration"], - help="A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backed IP.", - nullable=True, - ) - cls._build_args_network_interface_ip_configuration_update(_element.backend_ip_configuration) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - nullable=True, - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - nullable=True, - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - nullable=True, - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - _schema.etag = cls._args_network_interface_ip_configuration_update.etag - _schema.id = cls._args_network_interface_ip_configuration_update.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_update.name - _schema.primary = cls._args_network_interface_ip_configuration_update.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_update.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_update.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_update.subnet - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg( - nullable=True, - ) - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - network_security_group_update.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - nullable=True, - ) - network_security_group_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - network_security_group_update.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_update.network_interfaces - network_interfaces.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.network_interfaces.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - nullable=True, - ) - _element.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - nullable=True, - ) - _element.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - nullable=True, - ) - _element.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - nullable=True, - ) - _element.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(_element.network_security_group) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - nullable=True, - ) - _element.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.virtual_machine) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_network_security_group_update.network_interfaces.Element.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - nullable=True, - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - nullable=True, - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - nullable=True, - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - nullable=True, - ) - - applied_dns_servers = cls._args_network_security_group_update.network_interfaces.Element.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg( - nullable=True, - ) - - dns_servers = cls._args_network_security_group_update.network_interfaces.Element.dns_settings.dns_servers - dns_servers.Element = AAZStrArg( - nullable=True, - ) - - ip_configurations = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_network_interface_ip_configuration_update(ip_configurations.Element) - - tags = cls._args_network_security_group_update.network_interfaces.Element.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(security_rules.Element) - - subnets = cls._args_network_security_group_update.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - - _args_public_ip_address_update = None - - @classmethod - def _build_args_public_ip_address_update(cls, _schema): - if cls._args_public_ip_address_update is not None: - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.ip_configuration = cls._args_public_ip_address_update.ip_configuration - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.tags = cls._args_public_ip_address_update.tags - return - - cls._args_public_ip_address_update = AAZObjectArg( - nullable=True, - ) - - public_ip_address_update = cls._args_public_ip_address_update - public_ip_address_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - public_ip_address_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_update.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - nullable=True, - ) - public_ip_address_update.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - nullable=True, - ) - public_ip_address_update.ip_address = AAZStrArg( - options=["ip-address"], - nullable=True, - ) - public_ip_address_update.ip_configuration = AAZObjectArg( - options=["ip-configuration"], - nullable=True, - ) - cls._build_args_ip_configuration_update(public_ip_address_update.ip_configuration) - public_ip_address_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - public_ip_address_update.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - nullable=True, - ) - public_ip_address_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_public_ip_address_update.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - nullable=True, - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - nullable=True, - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - nullable=True, - ) - - tags = cls._args_public_ip_address_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.ip_configuration = cls._args_public_ip_address_update.ip_configuration - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.tags = cls._args_public_ip_address_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_subnet_update = None - - @classmethod - def _build_args_subnet_update(cls, _schema): - if cls._args_subnet_update is not None: - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.ip_configurations = cls._args_subnet_update.ip_configurations - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - return - - cls._args_subnet_update = AAZObjectArg( - nullable=True, - ) - - subnet_update = cls._args_subnet_update - subnet_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - subnet_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - subnet_update.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - nullable=True, - ) - subnet_update.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="Gets an array of references to the network interface IP configurations using subnet.", - nullable=True, - ) - subnet_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(subnet_update.network_security_group) - subnet_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - nullable=True, - ) - subnet_update.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - nullable=True, - ) - - ip_configurations = cls._args_subnet_update.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_ip_configuration_update(ip_configurations.Element) - - route_table = cls._args_subnet_update.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - nullable=True, - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - routes = cls._args_subnet_update.route_table.routes - routes.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - nullable=True, - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - nullable=True, - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - subnets = cls._args_subnet_update.route_table.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_subnet_update.route_table.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.ip_configurations = cls._args_subnet_update.ip_configurations - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - - def _execute_operations(self): - self.pre_operations() - self.NetworkSecurityGroupsGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.NetworkSecurityGroupsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkSecurityGroupsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_network_security_group_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkSecurityGroupsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_network_security_group_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_ip_configuration_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - @classmethod - def _build_schema_network_interface_ip_configuration_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("backendIPConfigurations", AAZListType, ".backend_ip_configurations") - cls._build_schema_sub_resource_update(properties.set_prop("outboundNatRule", AAZObjectType, ".outbound_nat_rule")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - backend_ip_configurations = _builder.get(".properties.loadBalancerBackendAddressPools[].properties.backendIPConfigurations") - if backend_ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_update(backend_ip_configurations.set_elements(AAZObjectType, ".")) - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - cls._build_schema_network_interface_ip_configuration_update(properties.set_prop("backendIPConfiguration", AAZObjectType, ".backend_ip_configuration")) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_update(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - network_interfaces.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkInterfaces[].properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_update(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.networkInterfaces[].properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_update(ip_configurations.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkInterfaces[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - cls._build_schema_security_rule_update(security_rules.set_elements(AAZObjectType, ".")) - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - cls._build_schema_ip_configuration_update(properties.set_prop("ipConfiguration", AAZObjectType, ".ip_configuration")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_ip_configuration_update(ip_configurations.set_elements(AAZObjectType, ".")) - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_wait.py deleted file mode 100644 index 4d0d3907e38..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/_wait.py +++ /dev/null @@ -1,726 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkSecurityGroupsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class NetworkSecurityGroupsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_network_security_group_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/__cmd_group.py deleted file mode 100644 index cf73713d97d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 nsg rule", -) -class __CMDGroup(AAZCommandGroup): - """Manage network security group rules. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_create.py deleted file mode 100644 index f04d47d6858..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_create.py +++ /dev/null @@ -1,323 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule create", -) -class Create(AAZCommand): - """Create a network security group rule. - - :example: Create a basic "Allow" NSG rule with the highest priority. - az network nsg rule create -g MyResourceGroup --nsg-name MyNsg -n MyNsgRule --priority 100 - - :example: Create a "Deny" rule over TCP for a specific IP address range with the lowest priority. - az network nsg rule create -g MyResourceGroup --nsg-name MyNsg -n MyNsgRule --priority 4096 --source-address-prefixes 208.130.28.0/24 --source-port-ranges 80 --destination-address-prefixes '*' --destination-port-ranges 80 8080 --access Deny --protocol Tcp --description "Deny from specific IP address ranges on 80 and 8080." - - :example: Create a security rule using service tags (https://aka.ms/servicetags). - az network nsg rule create -g MyResourceGroup --nsg-name MyNsg -n MyNsgRuleWithTags --priority 400 --source-address-prefixes VirtualNetwork --destination-address-prefixes Storage --destination-port-ranges '*' --direction Outbound --access Allow --protocol Tcp --description "Allow VirtualNetwork to Storage." - - :example: Create a security rule using application security groups (https://aka.ms/applicationsecuritygroups). - az network nsg rule create -g MyResourceGroup --nsg-name MyNsg -n MyNsgRuleWithAsg --priority 500 --source-address-prefixes Internet --destination-port-ranges 80 8080 --destination-asgs Web --access Allow --protocol Tcp --description "Allow Internet to Web ASG on ports 80,8080." - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group rule.", - required=True, - ) - _args_schema.access = AAZStrArg( - options=["--access"], - help="Network traffic is allowed or denied.", - default="Allow", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _args_schema.description = AAZStrArg( - options=["--description"], - help="Description for this rule. Restricted to 140 chars.", - ) - _args_schema.direction = AAZStrArg( - options=["--direction"], - help="Direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", - default="Inbound", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _args_schema.priority = AAZIntArg( - options=["--priority"], - help="Priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - help="Network protocol this rule applies to.", - default="*", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - # define Arg Group "Destination" - - _args_schema = cls._args_schema - _args_schema.destination_address_prefix = AAZStrArg( - options=["--destination-address-prefix"], - arg_group="Destination", - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - default="*", - ) - _args_schema.destination_port_range = AAZStrArg( - options=["--destination-port-range"], - arg_group="Destination", - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - default="80", - ) - - # define Arg Group "Properties" - - # define Arg Group "SecurityRuleParameters" - - # define Arg Group "Source" - - _args_schema = cls._args_schema - _args_schema.source_address_prefix = AAZStrArg( - options=["--source-address-prefix"], - arg_group="Source", - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.", - default="*", - ) - _args_schema.source_port_range = AAZStrArg( - options=["--source-port-range"], - arg_group="Source", - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - default="80", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.SecurityRulesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SecurityRulesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.name = AAZStrType() - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_delete.py deleted file mode 100644 index 1b147b7753c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_delete.py +++ /dev/null @@ -1,172 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule delete", -) -class Delete(AAZCommand): - """Delete a network security group rule. - - :example: Delete a network security group rule. - az network nsg rule delete -g MyResourceGroup --nsg-name MyNsg -n MyNsgRule - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group rule.", - required=True, - id_part="child_name_1", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.SecurityRulesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class SecurityRulesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_list.py deleted file mode 100644 index 8090ecc87fa..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_list.py +++ /dev/null @@ -1,208 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule list", -) -class List(AAZCommand): - """List all rules in a network security group. - - :example: List all rules in a network security group. - az network nsg rule list -g MyResourceGroup --nsg-name MyNsg - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SecurityRulesList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class SecurityRulesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_show.py deleted file mode 100644 index 5f514f96e3a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_show.py +++ /dev/null @@ -1,210 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule show", -) -class Show(AAZCommand): - """Get the details of a network security group rule. - - :example: Get the details of a network security group rule. - az network nsg rule show -g MyResourceGroup --nsg-name MyNsg -n MyNsgRule - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group rule.", - required=True, - id_part="child_name_1", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SecurityRulesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SecurityRulesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_update.py deleted file mode 100644 index 9a65084fd0d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_update.py +++ /dev/null @@ -1,458 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule update", -) -class Update(AAZCommand): - """Update a network security group rule. - - :example: Update an NSG rule with a new wildcard destination address prefix. - az network nsg rule update -g MyResourceGroup --nsg-name MyNsg -n MyNsgRule --destination-address-prefix '*' - - :example: Update a network security group rule. - az network nsg rule update --name MyNsgRule --nsg-name MyNsg --resource-group MyResourceGroup --source-address-prefixes 208.130.28/24 - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group rule.", - required=True, - id_part="child_name_1", - ) - _args_schema.access = AAZStrArg( - options=["--access"], - help="Network traffic is allowed or denied.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _args_schema.description = AAZStrArg( - options=["--description"], - help="Description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _args_schema.direction = AAZStrArg( - options=["--direction"], - help="Direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _args_schema.priority = AAZIntArg( - options=["--priority"], - help="Priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - help="Network protocol this rule applies to.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - # define Arg Group "Destination" - - _args_schema = cls._args_schema - _args_schema.destination_address_prefix = AAZStrArg( - options=["--destination-address-prefix"], - arg_group="Destination", - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _args_schema.destination_port_range = AAZStrArg( - options=["--destination-port-range"], - arg_group="Destination", - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - - # define Arg Group "Properties" - - # define Arg Group "SecurityRuleParameters" - - # define Arg Group "Source" - - _args_schema = cls._args_schema - _args_schema.source_address_prefix = AAZStrArg( - options=["--source-address-prefix"], - arg_group="Source", - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.", - ) - _args_schema.source_port_range = AAZStrArg( - options=["--source-port-range"], - arg_group="Source", - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SecurityRulesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.SecurityRulesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SecurityRulesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_security_rule_read(cls._schema_on_200) - - return cls._schema_on_200 - - class SecurityRulesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_security_rule_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_wait.py deleted file mode 100644 index 48fe36ba7dd..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/nsg/rule/_wait.py +++ /dev/null @@ -1,206 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group rule.", - required=True, - id_part="child_name_1", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SecurityRulesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class SecurityRulesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/__cmd_group.py deleted file mode 100644 index 07c867f7590..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 public-ip", -) -class __CMDGroup(AAZCommandGroup): - """Manage public IP addresses. - - To learn more about public IP addresses visit https://learn.microsoft.com/azure/virtual-network/virtual-network-public-ip-address. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_create.py deleted file mode 100644 index f75b4f41443..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_create.py +++ /dev/null @@ -1,998 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip create", -) -class Create(AAZCommand): - """Create a public IP address. - - :example: Create a basic public IP resource. - az network public-ip create -g MyResourceGroup -n MyIp - - :example: Create a static public IP resource for a DNS name label. - az network public-ip create -g MyResourceGroup -n MyIp --dns-name MyLabel --allocation-method Static - - :example: Create a public IP resource in an availability zone in the current resource group region. - az network public-ip create -g MyResourceGroup -n MyIp --zone 2 - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP address.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.dns_name = AAZStrArg( - options=["--dns-name"], - help="Globally unique DNS entry.", - ) - _args_schema.reverse_fqdn = AAZStrArg( - options=["--reverse-fqdn"], - help="Reverse FQDN (fully qualified domain name).", - ) - _args_schema.idle_timeout = AAZIntArg( - options=["--idle-timeout"], - help="Idle timeout in minutes.", - default=4, - ) - _args_schema.ip_address = AAZStrArg( - options=["--ip-address"], - help="The IP address associated with the public IP address resource.", - ) - _args_schema.allocation_method = AAZStrArg( - options=["--allocation-method"], - help="IP address allocation method. Allowed values: Dynamic, Static.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "DnsSettings" - - # define Arg Group "Parameters" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.PublicIPAddressesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class PublicIPAddressesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".allocation_method") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".dns_name") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_public_ip_address_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - flags={"read_only": True}, - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - flags={"read_only": True}, - ) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"read_only": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - flags={"read_only": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"read_only": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType( - flags={"read_only": True} - ) - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.location = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - network_security_group_read.tags = AAZDictType( - flags={"read_only": True}, - ) - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - flags={"read_only": True}, - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.location = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - _element.tags = AAZDictType( - flags={"read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - flags={"read_only": True}, - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - flags={"read_only": True}, - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - flags={"read_only": True}, - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - flags={"read_only": True}, - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - flags={"read_only": True}, - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType( - flags={"read_only": True} - ) - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.id = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.name = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.description = AAZStrType( - flags={"read_only": True}, - ) - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True, "read_only": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - flags={"read_only": True}, - ) - properties.direction = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.priority = AAZIntType( - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True, "read_only": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType( - flags={"read_only": True} - ) - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType( - flags={"read_only": True}, - ) - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType( - flags={"read_only": True} - ) - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.id = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.name = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - flags={"read_only": True}, - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType( - flags={"read_only": True}, - ) - route_table.id = AAZStrType( - flags={"read_only": True}, - ) - route_table.location = AAZStrType( - flags={"read_only": True}, - ) - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - route_table.tags = AAZDictType( - flags={"read_only": True}, - ) - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.routes = AAZListType( - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - flags={"read_only": True}, - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_delete.py deleted file mode 100644 index cdf00fe4410..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip delete", -) -class Delete(AAZCommand): - """Delete a public IP address. - - :example: Delete a public IP address. - az network public-ip delete -g MyResourceGroup -n MyIp - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP address.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.PublicIPAddressesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class PublicIPAddressesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_list.py deleted file mode 100644 index 3c2cd92ff3a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_list.py +++ /dev/null @@ -1,998 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip list", -) -class List(AAZCommand): - """List public IP addresses. - - :example: List all public IPs in a subscription. - az network public-ip list - - :example: List all public IPs in a resource group. - az network public-ip list -g MyResourceGroup - - :example: List all public IPs of a domain name label. - az network public-ip list -g MyResourceGroup --query "[?dnsSettings.domainNameLabel=='MyLabel']" - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/publicipaddresses", "2015-06-15"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.PublicIPAddressesList(ctx=self.ctx)() - if condition_1: - self.PublicIPAddressesListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class PublicIPAddressesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_public_ip_address_read(value.Element) - - return cls._schema_on_200 - - class PublicIPAddressesListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_public_ip_address_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - flags={"read_only": True}, - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - flags={"read_only": True}, - ) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"read_only": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - flags={"read_only": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"read_only": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType( - flags={"read_only": True} - ) - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.location = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - network_security_group_read.tags = AAZDictType( - flags={"read_only": True}, - ) - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - flags={"read_only": True}, - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.location = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - _element.tags = AAZDictType( - flags={"read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - flags={"read_only": True}, - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - flags={"read_only": True}, - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - flags={"read_only": True}, - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - flags={"read_only": True}, - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - flags={"read_only": True}, - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType( - flags={"read_only": True} - ) - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.id = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.name = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.description = AAZStrType( - flags={"read_only": True}, - ) - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True, "read_only": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - flags={"read_only": True}, - ) - properties.direction = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.priority = AAZIntType( - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True, "read_only": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType( - flags={"read_only": True} - ) - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType( - flags={"read_only": True}, - ) - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType( - flags={"read_only": True} - ) - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.id = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.name = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - flags={"read_only": True}, - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType( - flags={"read_only": True}, - ) - route_table.id = AAZStrType( - flags={"read_only": True}, - ) - route_table.location = AAZStrType( - flags={"read_only": True}, - ) - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - route_table.tags = AAZDictType( - flags={"read_only": True}, - ) - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.routes = AAZListType( - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - flags={"read_only": True}, - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_show.py deleted file mode 100644 index 908b287bf8d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_show.py +++ /dev/null @@ -1,915 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip show", -) -class Show(AAZCommand): - """Get the details of a public IP address. - - :example: Get information about a public IP resource. - az network public-ip show -g MyResourceGroup -n MyIp - - :example: Get the FQDN and IP address of a public IP resource. - az network public-ip show -g MyResourceGroup -n MyIp --query "{fqdn: dnsSettings.fqdn,address: ipAddress}" - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP address.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PublicIPAddressesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class PublicIPAddressesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_public_ip_address_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - flags={"read_only": True}, - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - flags={"read_only": True}, - ) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"read_only": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - flags={"read_only": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"read_only": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType( - flags={"read_only": True} - ) - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.location = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - network_security_group_read.tags = AAZDictType( - flags={"read_only": True}, - ) - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - flags={"read_only": True}, - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.location = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - _element.tags = AAZDictType( - flags={"read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - flags={"read_only": True}, - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - flags={"read_only": True}, - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - flags={"read_only": True}, - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - flags={"read_only": True}, - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - flags={"read_only": True}, - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType( - flags={"read_only": True} - ) - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.id = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.name = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.description = AAZStrType( - flags={"read_only": True}, - ) - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True, "read_only": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - flags={"read_only": True}, - ) - properties.direction = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.priority = AAZIntType( - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True, "read_only": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType( - flags={"read_only": True} - ) - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType( - flags={"read_only": True}, - ) - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType( - flags={"read_only": True} - ) - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.id = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.name = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - flags={"read_only": True}, - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType( - flags={"read_only": True}, - ) - route_table.id = AAZStrType( - flags={"read_only": True}, - ) - route_table.location = AAZStrType( - flags={"read_only": True}, - ) - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - route_table.tags = AAZDictType( - flags={"read_only": True}, - ) - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.routes = AAZListType( - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - flags={"read_only": True}, - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_update.py deleted file mode 100644 index b5601d163ac..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_update.py +++ /dev/null @@ -1,1106 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip update", -) -class Update(AAZCommand): - """Update a public IP address. - - :example: Update a public IP resource with a DNS name label and static allocation. - az network public-ip update -g MyResourceGroup -n MyIp --dns-name MyLabel --allocation-method Static - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP address.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.dns_name = AAZStrArg( - options=["--dns-name"], - help="Globally unique DNS entry.", - nullable=True, - ) - _args_schema.reverse_fqdn = AAZStrArg( - options=["--reverse-fqdn"], - help="Reverse FQDN (fully qualified domain name).", - nullable=True, - ) - _args_schema.idle_timeout = AAZIntArg( - options=["--idle-timeout"], - help="Idle timeout in minutes.", - nullable=True, - ) - _args_schema.allocation_method = AAZStrArg( - options=["--allocation-method"], - help="IP address allocation method. Allowed values: Dynamic, Static.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "DnsSettings" - - # define Arg Group "Parameters" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PublicIPAddressesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.PublicIPAddressesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class PublicIPAddressesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_public_ip_address_read(cls._schema_on_200) - - return cls._schema_on_200 - - class PublicIPAddressesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_public_ip_address_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".allocation_method") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".dns_name") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - flags={"read_only": True}, - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - flags={"read_only": True}, - ) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"read_only": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - flags={"read_only": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"read_only": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType( - flags={"read_only": True} - ) - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.location = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - network_security_group_read.tags = AAZDictType( - flags={"read_only": True}, - ) - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - flags={"read_only": True}, - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.location = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - _element.tags = AAZDictType( - flags={"read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - flags={"read_only": True}, - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - flags={"read_only": True}, - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - flags={"read_only": True}, - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - flags={"read_only": True}, - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - flags={"read_only": True}, - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType( - flags={"read_only": True} - ) - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.id = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.name = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.description = AAZStrType( - flags={"read_only": True}, - ) - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True, "read_only": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - flags={"read_only": True}, - ) - properties.direction = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.priority = AAZIntType( - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True, "read_only": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType( - flags={"read_only": True} - ) - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType( - flags={"read_only": True}, - ) - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType( - flags={"read_only": True} - ) - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.id = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.name = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - flags={"read_only": True}, - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType( - flags={"read_only": True}, - ) - route_table.id = AAZStrType( - flags={"read_only": True}, - ) - route_table.location = AAZStrType( - flags={"read_only": True}, - ) - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - route_table.tags = AAZDictType( - flags={"read_only": True}, - ) - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.routes = AAZListType( - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - flags={"read_only": True}, - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_wait.py deleted file mode 100644 index 0071e0f0f62..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/public_ip/_wait.py +++ /dev/null @@ -1,908 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP address.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PublicIPAddressesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class PublicIPAddressesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_public_ip_address_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - flags={"read_only": True}, - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - flags={"read_only": True}, - ) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"read_only": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - flags={"read_only": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"read_only": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType( - flags={"read_only": True} - ) - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.location = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - network_security_group_read.tags = AAZDictType( - flags={"read_only": True}, - ) - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - flags={"read_only": True}, - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.location = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - _element.tags = AAZDictType( - flags={"read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - flags={"read_only": True}, - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - flags={"read_only": True}, - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - flags={"read_only": True}, - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - flags={"read_only": True}, - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - flags={"read_only": True}, - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType( - flags={"read_only": True} - ) - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.id = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.name = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.description = AAZStrType( - flags={"read_only": True}, - ) - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True, "read_only": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - flags={"read_only": True}, - ) - properties.direction = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.priority = AAZIntType( - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True, "read_only": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType( - flags={"read_only": True} - ) - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType( - flags={"read_only": True}, - ) - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType( - flags={"read_only": True} - ) - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.id = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.name = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - flags={"read_only": True}, - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType( - flags={"read_only": True}, - ) - route_table.id = AAZStrType( - flags={"read_only": True}, - ) - route_table.location = AAZStrType( - flags={"read_only": True}, - ) - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - route_table.tags = AAZDictType( - flags={"read_only": True}, - ) - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.routes = AAZListType( - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - flags={"read_only": True}, - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/__cmd_group.py deleted file mode 100644 index 88087e0bdc5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 route-table", -) -class __CMDGroup(AAZCommandGroup): - """Manage route tables. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_create.py deleted file mode 100644 index 0df3de770db..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_create.py +++ /dev/null @@ -1,1853 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table create", -) -class Create(AAZCommand): - """Create a route table. - - :example: Create a route table. - az network route-table create -g MyResourceGroup -n MyRouteTable - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the route table.", - required=True, - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - arg_group="Parameters", - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Parameters", - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Properties" - return cls._args_schema - - _args_ip_configuration_create = None - - @classmethod - def _build_args_ip_configuration_create(cls, _schema): - if cls._args_ip_configuration_create is not None: - _schema.etag = cls._args_ip_configuration_create.etag - _schema.id = cls._args_ip_configuration_create.id - _schema.name = cls._args_ip_configuration_create.name - _schema.private_ip_address = cls._args_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_create.private_ip_allocation_method - _schema.provisioning_state = cls._args_ip_configuration_create.provisioning_state - _schema.public_ip_address = cls._args_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_ip_configuration_create.subnet - return - - cls._args_ip_configuration_create = AAZObjectArg() - - ip_configuration_create = cls._args_ip_configuration_create - ip_configuration_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - ip_configuration_create.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - ip_configuration_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - ip_configuration_create.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="The private IP address of the IP configuration.", - ) - ip_configuration_create.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP allocation method. Possible values are 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - ip_configuration_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - ip_configuration_create.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference of the public IP resource.", - ) - cls._build_args_public_ip_address_create(ip_configuration_create.public_ip_address) - ip_configuration_create.subnet = AAZObjectArg( - options=["subnet"], - help="The reference of the subnet resource.", - ) - cls._build_args_subnet_create(ip_configuration_create.subnet) - - _schema.etag = cls._args_ip_configuration_create.etag - _schema.id = cls._args_ip_configuration_create.id - _schema.name = cls._args_ip_configuration_create.name - _schema.private_ip_address = cls._args_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_create.private_ip_allocation_method - _schema.provisioning_state = cls._args_ip_configuration_create.provisioning_state - _schema.public_ip_address = cls._args_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_ip_configuration_create.subnet - - _args_network_interface_ip_configuration_create = None - - @classmethod - def _build_args_network_interface_ip_configuration_create(cls, _schema): - if cls._args_network_interface_ip_configuration_create is not None: - _schema.etag = cls._args_network_interface_ip_configuration_create.etag - _schema.id = cls._args_network_interface_ip_configuration_create.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_create.name - _schema.primary = cls._args_network_interface_ip_configuration_create.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_create.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_create.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_create.subnet - return - - cls._args_network_interface_ip_configuration_create = AAZObjectArg() - - network_interface_ip_configuration_create = cls._args_network_interface_ip_configuration_create - network_interface_ip_configuration_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_interface_ip_configuration_create.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - network_interface_ip_configuration_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - network_interface_ip_configuration_create.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - ) - network_interface_ip_configuration_create.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - ) - network_interface_ip_configuration_create.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - ) - network_interface_ip_configuration_create.private_ip_address = AAZStrArg( - options=["private-ip-address"], - ) - network_interface_ip_configuration_create.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - network_interface_ip_configuration_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - ) - network_interface_ip_configuration_create.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address resource.", - ) - cls._build_args_public_ip_address_create(network_interface_ip_configuration_create.public_ip_address) - network_interface_ip_configuration_create.subnet = AAZObjectArg( - options=["subnet"], - ) - cls._build_args_subnet_create(network_interface_ip_configuration_create.subnet) - - load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.backend_ip_configurations = AAZListArg( - options=["backend-ip-configurations"], - help="Gets collection of references to IP addresses defined in network interfaces.", - ) - _element.outbound_nat_rule = AAZObjectArg( - options=["outbound-nat-rule"], - help="Gets outbound rules that use this backend address pool.", - ) - cls._build_args_sub_resource_create(_element.outbound_nat_rule) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - backend_ip_configurations = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools.Element.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectArg() - cls._build_args_network_interface_ip_configuration_create(backend_ip_configurations.Element) - - load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.backend_ip_configuration = AAZObjectArg( - options=["backend-ip-configuration"], - help="A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backed IP.", - ) - cls._build_args_network_interface_ip_configuration_create(_element.backend_ip_configuration) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - _schema.etag = cls._args_network_interface_ip_configuration_create.etag - _schema.id = cls._args_network_interface_ip_configuration_create.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_create.name - _schema.primary = cls._args_network_interface_ip_configuration_create.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_create.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_create.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_create.subnet - - _args_network_security_group_create = None - - @classmethod - def _build_args_network_security_group_create(cls, _schema): - if cls._args_network_security_group_create is not None: - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.location = cls._args_network_security_group_create.location - _schema.network_interfaces = cls._args_network_security_group_create.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_create.provisioning_state - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.subnets = cls._args_network_security_group_create.subnets - _schema.tags = cls._args_network_security_group_create.tags - return - - cls._args_network_security_group_create = AAZObjectArg() - - network_security_group_create = cls._args_network_security_group_create - network_security_group_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_create.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - network_security_group_create.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - ) - network_security_group_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - network_security_group_create.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - network_security_group_create.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group_create.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - network_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_network_security_group_create.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_create(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_create.network_interfaces - network_interfaces.Element = AAZObjectArg() - - _element = cls._args_network_security_group_create.network_interfaces.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - ) - _element.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - ) - _element.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - ) - _element.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - ) - _element.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_create(_element.network_security_group) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - ) - _element.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - ) - cls._build_args_sub_resource_create(_element.virtual_machine) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_network_security_group_create.network_interfaces.Element.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - ) - - applied_dns_servers = cls._args_network_security_group_create.network_interfaces.Element.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg() - - dns_servers = cls._args_network_security_group_create.network_interfaces.Element.dns_settings.dns_servers - dns_servers.Element = AAZStrArg() - - ip_configurations = cls._args_network_security_group_create.network_interfaces.Element.ip_configurations - ip_configurations.Element = AAZObjectArg() - cls._build_args_network_interface_ip_configuration_create(ip_configurations.Element) - - tags = cls._args_network_security_group_create.network_interfaces.Element.tags - tags.Element = AAZStrArg() - - security_rules = cls._args_network_security_group_create.security_rules - security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_create(security_rules.Element) - - subnets = cls._args_network_security_group_create.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_create(subnets.Element) - - tags = cls._args_network_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.location = cls._args_network_security_group_create.location - _schema.network_interfaces = cls._args_network_security_group_create.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_create.provisioning_state - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.subnets = cls._args_network_security_group_create.subnets - _schema.tags = cls._args_network_security_group_create.tags - - _args_public_ip_address_create = None - - @classmethod - def _build_args_public_ip_address_create(cls, _schema): - if cls._args_public_ip_address_create is not None: - _schema.dns_settings = cls._args_public_ip_address_create.dns_settings - _schema.etag = cls._args_public_ip_address_create.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_create.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_create.ip_address - _schema.ip_configuration = cls._args_public_ip_address_create.ip_configuration - _schema.location = cls._args_public_ip_address_create.location - _schema.provisioning_state = cls._args_public_ip_address_create.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_create.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_create.resource_guid - _schema.tags = cls._args_public_ip_address_create.tags - return - - cls._args_public_ip_address_create = AAZObjectArg() - - public_ip_address_create = cls._args_public_ip_address_create - public_ip_address_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - public_ip_address_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_create.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - ) - public_ip_address_create.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - ) - public_ip_address_create.ip_address = AAZStrArg( - options=["ip-address"], - ) - public_ip_address_create.ip_configuration = AAZObjectArg( - options=["ip-configuration"], - help="IPConfiguration", - ) - cls._build_args_ip_configuration_create(public_ip_address_create.ip_configuration) - public_ip_address_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - public_ip_address_create.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_create.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - ) - public_ip_address_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_public_ip_address_create.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - ) - - tags = cls._args_public_ip_address_create.tags - tags.Element = AAZStrArg() - - _schema.dns_settings = cls._args_public_ip_address_create.dns_settings - _schema.etag = cls._args_public_ip_address_create.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_create.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_create.ip_address - _schema.ip_configuration = cls._args_public_ip_address_create.ip_configuration - _schema.location = cls._args_public_ip_address_create.location - _schema.provisioning_state = cls._args_public_ip_address_create.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_create.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_create.resource_guid - _schema.tags = cls._args_public_ip_address_create.tags - - _args_route_table_create = None - - @classmethod - def _build_args_route_table_create(cls, _schema): - if cls._args_route_table_create is not None: - _schema.etag = cls._args_route_table_create.etag - _schema.id = cls._args_route_table_create.id - _schema.location = cls._args_route_table_create.location - _schema.provisioning_state = cls._args_route_table_create.provisioning_state - _schema.routes = cls._args_route_table_create.routes - _schema.subnets = cls._args_route_table_create.subnets - _schema.tags = cls._args_route_table_create.tags - return - - cls._args_route_table_create = AAZObjectArg() - - route_table_create = cls._args_route_table_create - route_table_create.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - route_table_create.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - route_table_create.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table_create.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - route_table_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_route_table_create.routes - routes.Element = AAZObjectArg() - - _element = cls._args_route_table_create.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - subnets = cls._args_route_table_create.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_create(subnets.Element) - - tags = cls._args_route_table_create.tags - tags.Element = AAZStrArg() - - _schema.etag = cls._args_route_table_create.etag - _schema.id = cls._args_route_table_create.id - _schema.location = cls._args_route_table_create.location - _schema.provisioning_state = cls._args_route_table_create.provisioning_state - _schema.routes = cls._args_route_table_create.routes - _schema.subnets = cls._args_route_table_create.subnets - _schema.tags = cls._args_route_table_create.tags - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_port_range = cls._args_security_rule_create.source_port_range - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_port_range = cls._args_security_rule_create.source_port_range - - _args_sub_resource_create = None - - @classmethod - def _build_args_sub_resource_create(cls, _schema): - if cls._args_sub_resource_create is not None: - _schema.id = cls._args_sub_resource_create.id - return - - cls._args_sub_resource_create = AAZObjectArg() - - sub_resource_create = cls._args_sub_resource_create - sub_resource_create.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - - _schema.id = cls._args_sub_resource_create.id - - _args_subnet_create = None - - @classmethod - def _build_args_subnet_create(cls, _schema): - if cls._args_subnet_create is not None: - _schema.address_prefix = cls._args_subnet_create.address_prefix - _schema.etag = cls._args_subnet_create.etag - _schema.ip_configurations = cls._args_subnet_create.ip_configurations - _schema.name = cls._args_subnet_create.name - _schema.network_security_group = cls._args_subnet_create.network_security_group - _schema.provisioning_state = cls._args_subnet_create.provisioning_state - _schema.route_table = cls._args_subnet_create.route_table - return - - cls._args_subnet_create = AAZObjectArg() - - subnet_create = cls._args_subnet_create - subnet_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - subnet_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - subnet_create.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - subnet_create.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="Gets an array of references to the network interface IP configurations using subnet.", - ) - subnet_create.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_create(subnet_create.network_security_group) - subnet_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - ) - subnet_create.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - ) - cls._build_args_route_table_create(subnet_create.route_table) - - ip_configurations = cls._args_subnet_create.ip_configurations - ip_configurations.Element = AAZObjectArg() - cls._build_args_ip_configuration_create(ip_configurations.Element) - - _schema.address_prefix = cls._args_subnet_create.address_prefix - _schema.etag = cls._args_subnet_create.etag - _schema.ip_configurations = cls._args_subnet_create.ip_configurations - _schema.name = cls._args_subnet_create.name - _schema.network_security_group = cls._args_subnet_create.network_security_group - _schema.provisioning_state = cls._args_subnet_create.provisioning_state - _schema.route_table = cls._args_subnet_create.route_table - - def _execute_operations(self): - self.pre_operations() - yield self.RouteTablesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RouteTablesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_route_table_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_ip_configuration_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_create(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_create(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - @classmethod - def _build_schema_network_interface_ip_configuration_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_create(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_create(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("backendIPConfigurations", AAZListType, ".backend_ip_configurations") - cls._build_schema_sub_resource_create(properties.set_prop("outboundNatRule", AAZObjectType, ".outbound_nat_rule")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - backend_ip_configurations = _builder.get(".properties.loadBalancerBackendAddressPools[].properties.backendIPConfigurations") - if backend_ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_create(backend_ip_configurations.set_elements(AAZObjectType, ".")) - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - cls._build_schema_network_interface_ip_configuration_create(properties.set_prop("backendIPConfiguration", AAZObjectType, ".backend_ip_configuration")) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_network_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_create(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - network_interfaces.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkInterfaces[].properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - cls._build_schema_network_security_group_create(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_create(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.networkInterfaces[].properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_create(ip_configurations.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkInterfaces[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - cls._build_schema_security_rule_create(security_rules.set_elements(AAZObjectType, ".")) - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_create(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - cls._build_schema_ip_configuration_create(properties.set_prop("ipConfiguration", AAZObjectType, ".ip_configuration")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_route_table_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_create(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - cls._build_schema_network_security_group_create(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_route_table_create(properties.set_prop("routeTable", AAZObjectType, ".route_table")) - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_ip_configuration_create(ip_configurations.set_elements(AAZObjectType, ".")) - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_route_table_read = None - - @classmethod - def _build_schema_route_table_read(cls, _schema): - if cls._schema_route_table_read is not None: - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - return - - cls._schema_route_table_read = _schema_route_table_read = AAZObjectType() - - route_table_read = _schema_route_table_read - route_table_read.etag = AAZStrType() - route_table_read.id = AAZStrType() - route_table_read.location = AAZStrType() - route_table_read.name = AAZStrType( - flags={"read_only": True}, - ) - route_table_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table_read.tags = AAZDictType() - route_table_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_route_table_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_route_table_read.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_route_table_read.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_table_read.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_route_table_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_route_table_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - cls._build_schema_route_table_read(properties.route_table) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_delete.py deleted file mode 100644 index b1af7bad132..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_delete.py +++ /dev/null @@ -1,163 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table delete", - confirmation="Are you sure you want to perform this operation?", -) -class Delete(AAZCommand): - """Delete a route table. - - :example: Delete a route table. - az network route-table delete -g MyResourceGroup -n MyRouteTable - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the route table.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.RouteTablesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class RouteTablesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_list.py deleted file mode 100644 index fbb5850c9cc..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_list.py +++ /dev/null @@ -1,835 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table list", -) -class List(AAZCommand): - """List route tables. - - :example: List all route tables in a subscription. - az network route-table list -g MyResourceGroup - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/routetables", "2015-06-15"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - if condition_0: - self.RouteTablesListAll(ctx=self.ctx)() - if condition_1: - self.RouteTablesList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class RouteTablesListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_route_table_read(value.Element) - - return cls._schema_on_200 - - class RouteTablesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_route_table_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_route_table_read = None - - @classmethod - def _build_schema_route_table_read(cls, _schema): - if cls._schema_route_table_read is not None: - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - return - - cls._schema_route_table_read = _schema_route_table_read = AAZObjectType() - - route_table_read = _schema_route_table_read - route_table_read.etag = AAZStrType() - route_table_read.id = AAZStrType() - route_table_read.location = AAZStrType() - route_table_read.name = AAZStrType( - flags={"read_only": True}, - ) - route_table_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table_read.tags = AAZDictType() - route_table_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_route_table_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_route_table_read.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_route_table_read.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_table_read.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_route_table_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_route_table_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - cls._build_schema_route_table_read(properties.route_table) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_show.py deleted file mode 100644 index b2633e9b63c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_show.py +++ /dev/null @@ -1,755 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table show", -) -class Show(AAZCommand): - """Get the details of a route table. - - :example: Get the details of a route table. - az network route-table show -g MyResourceGroup -n MyRouteTable - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the route table.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RouteTablesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RouteTablesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_route_table_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_route_table_read = None - - @classmethod - def _build_schema_route_table_read(cls, _schema): - if cls._schema_route_table_read is not None: - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - return - - cls._schema_route_table_read = _schema_route_table_read = AAZObjectType() - - route_table_read = _schema_route_table_read - route_table_read.etag = AAZStrType() - route_table_read.id = AAZStrType() - route_table_read.location = AAZStrType() - route_table_read.name = AAZStrType( - flags={"read_only": True}, - ) - route_table_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table_read.tags = AAZDictType() - route_table_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_route_table_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_route_table_read.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_route_table_read.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_table_read.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_route_table_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_route_table_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - cls._build_schema_route_table_read(properties.route_table) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_update.py deleted file mode 100644 index 7906aec5e79..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_update.py +++ /dev/null @@ -1,2121 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table update", -) -class Update(AAZCommand): - """Update a route table. - - :example: Update a route table to disable BGP route propagation. - az network route-table update -g MyResourceGroup -n MyRouteTable --disable-bgp-route-propagation true - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the route table.", - required=True, - id_part="name", - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Parameters", - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Properties" - return cls._args_schema - - _args_ip_configuration_update = None - - @classmethod - def _build_args_ip_configuration_update(cls, _schema): - if cls._args_ip_configuration_update is not None: - _schema.etag = cls._args_ip_configuration_update.etag - _schema.id = cls._args_ip_configuration_update.id - _schema.name = cls._args_ip_configuration_update.name - _schema.private_ip_address = cls._args_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_update.private_ip_allocation_method - _schema.provisioning_state = cls._args_ip_configuration_update.provisioning_state - _schema.public_ip_address = cls._args_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_ip_configuration_update.subnet - return - - cls._args_ip_configuration_update = AAZObjectArg( - nullable=True, - ) - - ip_configuration_update = cls._args_ip_configuration_update - ip_configuration_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - ip_configuration_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - ip_configuration_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - ip_configuration_update.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="The private IP address of the IP configuration.", - nullable=True, - ) - ip_configuration_update.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP allocation method. Possible values are 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - ip_configuration_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - ip_configuration_update.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference of the public IP resource.", - nullable=True, - ) - cls._build_args_public_ip_address_update(ip_configuration_update.public_ip_address) - ip_configuration_update.subnet = AAZObjectArg( - options=["subnet"], - help="The reference of the subnet resource.", - nullable=True, - ) - cls._build_args_subnet_update(ip_configuration_update.subnet) - - _schema.etag = cls._args_ip_configuration_update.etag - _schema.id = cls._args_ip_configuration_update.id - _schema.name = cls._args_ip_configuration_update.name - _schema.private_ip_address = cls._args_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_update.private_ip_allocation_method - _schema.provisioning_state = cls._args_ip_configuration_update.provisioning_state - _schema.public_ip_address = cls._args_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_ip_configuration_update.subnet - - _args_network_interface_ip_configuration_update = None - - @classmethod - def _build_args_network_interface_ip_configuration_update(cls, _schema): - if cls._args_network_interface_ip_configuration_update is not None: - _schema.etag = cls._args_network_interface_ip_configuration_update.etag - _schema.id = cls._args_network_interface_ip_configuration_update.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_update.name - _schema.primary = cls._args_network_interface_ip_configuration_update.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_update.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_update.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_update.subnet - return - - cls._args_network_interface_ip_configuration_update = AAZObjectArg( - nullable=True, - ) - - network_interface_ip_configuration_update = cls._args_network_interface_ip_configuration_update - network_interface_ip_configuration_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_interface_ip_configuration_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - network_interface_ip_configuration_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - network_interface_ip_configuration_update.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - nullable=True, - ) - network_interface_ip_configuration_update.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - nullable=True, - ) - network_interface_ip_configuration_update.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - nullable=True, - ) - network_interface_ip_configuration_update.private_ip_address = AAZStrArg( - options=["private-ip-address"], - nullable=True, - ) - network_interface_ip_configuration_update.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - network_interface_ip_configuration_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - nullable=True, - ) - network_interface_ip_configuration_update.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address resource.", - nullable=True, - ) - cls._build_args_public_ip_address_update(network_interface_ip_configuration_update.public_ip_address) - network_interface_ip_configuration_update.subnet = AAZObjectArg( - options=["subnet"], - nullable=True, - ) - cls._build_args_subnet_update(network_interface_ip_configuration_update.subnet) - - load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.backend_ip_configurations = AAZListArg( - options=["backend-ip-configurations"], - help="Gets collection of references to IP addresses defined in network interfaces.", - nullable=True, - ) - _element.outbound_nat_rule = AAZObjectArg( - options=["outbound-nat-rule"], - help="Gets outbound rules that use this backend address pool.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.outbound_nat_rule) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - backend_ip_configurations = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools.Element.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_network_interface_ip_configuration_update(backend_ip_configurations.Element) - - load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.backend_ip_configuration = AAZObjectArg( - options=["backend-ip-configuration"], - help="A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backed IP.", - nullable=True, - ) - cls._build_args_network_interface_ip_configuration_update(_element.backend_ip_configuration) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - nullable=True, - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - nullable=True, - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - nullable=True, - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - _schema.etag = cls._args_network_interface_ip_configuration_update.etag - _schema.id = cls._args_network_interface_ip_configuration_update.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_update.name - _schema.primary = cls._args_network_interface_ip_configuration_update.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_update.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_update.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_update.subnet - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg( - nullable=True, - ) - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - network_security_group_update.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - nullable=True, - ) - network_security_group_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - network_security_group_update.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_update.network_interfaces - network_interfaces.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.network_interfaces.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - nullable=True, - ) - _element.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - nullable=True, - ) - _element.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - nullable=True, - ) - _element.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - nullable=True, - ) - _element.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(_element.network_security_group) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - nullable=True, - ) - _element.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.virtual_machine) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_network_security_group_update.network_interfaces.Element.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - nullable=True, - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - nullable=True, - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - nullable=True, - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - nullable=True, - ) - - applied_dns_servers = cls._args_network_security_group_update.network_interfaces.Element.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg( - nullable=True, - ) - - dns_servers = cls._args_network_security_group_update.network_interfaces.Element.dns_settings.dns_servers - dns_servers.Element = AAZStrArg( - nullable=True, - ) - - ip_configurations = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_network_interface_ip_configuration_update(ip_configurations.Element) - - tags = cls._args_network_security_group_update.network_interfaces.Element.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(security_rules.Element) - - subnets = cls._args_network_security_group_update.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - - _args_public_ip_address_update = None - - @classmethod - def _build_args_public_ip_address_update(cls, _schema): - if cls._args_public_ip_address_update is not None: - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.ip_configuration = cls._args_public_ip_address_update.ip_configuration - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.tags = cls._args_public_ip_address_update.tags - return - - cls._args_public_ip_address_update = AAZObjectArg( - nullable=True, - ) - - public_ip_address_update = cls._args_public_ip_address_update - public_ip_address_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - public_ip_address_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_update.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - nullable=True, - ) - public_ip_address_update.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - nullable=True, - ) - public_ip_address_update.ip_address = AAZStrArg( - options=["ip-address"], - nullable=True, - ) - public_ip_address_update.ip_configuration = AAZObjectArg( - options=["ip-configuration"], - help="IPConfiguration", - nullable=True, - ) - cls._build_args_ip_configuration_update(public_ip_address_update.ip_configuration) - public_ip_address_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - public_ip_address_update.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - nullable=True, - ) - public_ip_address_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_public_ip_address_update.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - nullable=True, - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - nullable=True, - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - nullable=True, - ) - - tags = cls._args_public_ip_address_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.ip_configuration = cls._args_public_ip_address_update.ip_configuration - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.tags = cls._args_public_ip_address_update.tags - - _args_route_table_update = None - - @classmethod - def _build_args_route_table_update(cls, _schema): - if cls._args_route_table_update is not None: - _schema.etag = cls._args_route_table_update.etag - _schema.id = cls._args_route_table_update.id - _schema.location = cls._args_route_table_update.location - _schema.provisioning_state = cls._args_route_table_update.provisioning_state - _schema.routes = cls._args_route_table_update.routes - _schema.subnets = cls._args_route_table_update.subnets - _schema.tags = cls._args_route_table_update.tags - return - - cls._args_route_table_update = AAZObjectArg( - nullable=True, - ) - - route_table_update = cls._args_route_table_update - route_table_update.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - route_table_update.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - route_table_update.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - nullable=True, - ) - route_table_update.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - route_table_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - routes = cls._args_route_table_update.routes - routes.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_route_table_update.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - nullable=True, - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - nullable=True, - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - subnets = cls._args_route_table_update.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_route_table_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.etag = cls._args_route_table_update.etag - _schema.id = cls._args_route_table_update.id - _schema.location = cls._args_route_table_update.location - _schema.provisioning_state = cls._args_route_table_update.provisioning_state - _schema.routes = cls._args_route_table_update.routes - _schema.subnets = cls._args_route_table_update.subnets - _schema.tags = cls._args_route_table_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_subnet_update = None - - @classmethod - def _build_args_subnet_update(cls, _schema): - if cls._args_subnet_update is not None: - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.ip_configurations = cls._args_subnet_update.ip_configurations - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - return - - cls._args_subnet_update = AAZObjectArg( - nullable=True, - ) - - subnet_update = cls._args_subnet_update - subnet_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - subnet_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - subnet_update.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - nullable=True, - ) - subnet_update.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="Gets an array of references to the network interface IP configurations using subnet.", - nullable=True, - ) - subnet_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(subnet_update.network_security_group) - subnet_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - nullable=True, - ) - subnet_update.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - nullable=True, - ) - cls._build_args_route_table_update(subnet_update.route_table) - - ip_configurations = cls._args_subnet_update.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_ip_configuration_update(ip_configurations.Element) - - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.ip_configurations = cls._args_subnet_update.ip_configurations - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.provisioning_state = cls._args_subnet_update.provisioning_state - _schema.route_table = cls._args_subnet_update.route_table - - def _execute_operations(self): - self.pre_operations() - self.RouteTablesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.RouteTablesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RouteTablesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_route_table_read(cls._schema_on_200) - - return cls._schema_on_200 - - class RouteTablesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_route_table_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_ip_configuration_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - @classmethod - def _build_schema_network_interface_ip_configuration_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("backendIPConfigurations", AAZListType, ".backend_ip_configurations") - cls._build_schema_sub_resource_update(properties.set_prop("outboundNatRule", AAZObjectType, ".outbound_nat_rule")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - backend_ip_configurations = _builder.get(".properties.loadBalancerBackendAddressPools[].properties.backendIPConfigurations") - if backend_ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_update(backend_ip_configurations.set_elements(AAZObjectType, ".")) - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - cls._build_schema_network_interface_ip_configuration_update(properties.set_prop("backendIPConfiguration", AAZObjectType, ".backend_ip_configuration")) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_update(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - network_interfaces.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkInterfaces[].properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_update(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.networkInterfaces[].properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_update(ip_configurations.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkInterfaces[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - cls._build_schema_security_rule_update(security_rules.set_elements(AAZObjectType, ".")) - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - cls._build_schema_ip_configuration_update(properties.set_prop("ipConfiguration", AAZObjectType, ".ip_configuration")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_route_table_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_route_table_update(properties.set_prop("routeTable", AAZObjectType, ".route_table")) - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_ip_configuration_update(ip_configurations.set_elements(AAZObjectType, ".")) - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_route_table_read = None - - @classmethod - def _build_schema_route_table_read(cls, _schema): - if cls._schema_route_table_read is not None: - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - return - - cls._schema_route_table_read = _schema_route_table_read = AAZObjectType() - - route_table_read = _schema_route_table_read - route_table_read.etag = AAZStrType() - route_table_read.id = AAZStrType() - route_table_read.location = AAZStrType() - route_table_read.name = AAZStrType( - flags={"read_only": True}, - ) - route_table_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table_read.tags = AAZDictType() - route_table_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_route_table_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_route_table_read.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_route_table_read.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_table_read.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_route_table_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_route_table_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - cls._build_schema_route_table_read(properties.route_table) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_wait.py deleted file mode 100644 index e79e42a1496..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/_wait.py +++ /dev/null @@ -1,751 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the route table.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RouteTablesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class RouteTablesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_route_table_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_route_table_read = None - - @classmethod - def _build_schema_route_table_read(cls, _schema): - if cls._schema_route_table_read is not None: - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - return - - cls._schema_route_table_read = _schema_route_table_read = AAZObjectType() - - route_table_read = _schema_route_table_read - route_table_read.etag = AAZStrType() - route_table_read.id = AAZStrType() - route_table_read.location = AAZStrType() - route_table_read.name = AAZStrType( - flags={"read_only": True}, - ) - route_table_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table_read.tags = AAZDictType() - route_table_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_route_table_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_route_table_read.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_route_table_read.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_table_read.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_route_table_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_route_table_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - cls._build_schema_route_table_read(properties.route_table) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/__cmd_group.py deleted file mode 100644 index 1eeb0b10800..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 route-table route", -) -class __CMDGroup(AAZCommandGroup): - """Manage routes in a route table. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_create.py deleted file mode 100644 index 4944b0093e9..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_create.py +++ /dev/null @@ -1,253 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route create", -) -class Create(AAZCommand): - """Create a route in a route table. - - :example: Create a route that forces all inbound traffic to a Network Virtual Appliance. - az network route-table route create -g MyResourceGroup --route-table-name MyRouteTable -n MyRoute --next-hop-type VirtualAppliance --address-prefix 10.0.0.0/16 --next-hop-ip-address 10.0.100.4 - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Route name.", - required=True, - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.address_prefix = AAZStrArg( - options=["--address-prefix"], - arg_group="Properties", - help="The destination CIDR to which the route applies.", - ) - _args_schema.next_hop_ip_address = AAZStrArg( - options=["--next-hop-ip-address"], - arg_group="Properties", - help="The IP address packets should be forwarded to when using the VirtualAppliance hop type.", - ) - _args_schema.next_hop_type = AAZStrArg( - options=["--next-hop-type"], - arg_group="Properties", - help="The type of Azure hop the packet should be sent to.", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - - # define Arg Group "RouteParameters" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.RoutesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RoutesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.name = AAZStrType() - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_delete.py deleted file mode 100644 index 832f2931059..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_delete.py +++ /dev/null @@ -1,173 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route delete", - confirmation="Are you sure you want to perform this operation?", -) -class Delete(AAZCommand): - """Delete a route from a route table. - - :example: Delete a route from a route table. - az network route-table route delete -g MyResourceGroup --route-table-name MyRouteTable -n MyRoute - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Route name.", - required=True, - id_part="child_name_1", - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.RoutesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class RoutesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_list.py deleted file mode 100644 index cb29568d6c5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_list.py +++ /dev/null @@ -1,193 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route list", -) -class List(AAZCommand): - """List routes in a route table. - - :example: List routes in a route table. - az network route-table route list -g MyResourceGroup --route-table-name MyRouteTable - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RoutesList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class RoutesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_show.py deleted file mode 100644 index 0ebe50ef397..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_show.py +++ /dev/null @@ -1,195 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route show", -) -class Show(AAZCommand): - """Get the details of a route in a route table. - - :example: Get the details of a route in a route table. - az network route-table route show -g MyResourceGroup --route-table-name MyRouteTable -n MyRoute -o table - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Route name.", - required=True, - id_part="child_name_1", - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RoutesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RoutesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_update.py deleted file mode 100644 index 0362a645803..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_update.py +++ /dev/null @@ -1,402 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route update", -) -class Update(AAZCommand): - """Update a route in a route table. - - :example: Update a route in a route table to change the next hop ip address. - az network route-table route update -g MyResourceGroup --route-table-name MyRouteTable -n MyRoute --next-hop-ip-address 10.0.100.5 - - :example: Update a route in a route table. - az network route-table route update --address-prefix 10.0.0.0/16 --name MyRoute --next-hop-ip-address 10.0.100.5 --next-hop-type VirtualNetworkGateway --resource-group MyResourceGroup --route-table-name MyRouteTable - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Route name.", - required=True, - id_part="child_name_1", - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - id_part="name", - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.address_prefix = AAZStrArg( - options=["--address-prefix"], - arg_group="Properties", - help="The destination CIDR to which the route applies.", - nullable=True, - ) - _args_schema.next_hop_ip_address = AAZStrArg( - options=["--next-hop-ip-address"], - arg_group="Properties", - help="The IP address packets should be forwarded to when using the VirtualAppliance hop type.", - nullable=True, - ) - _args_schema.next_hop_type = AAZStrArg( - options=["--next-hop-type"], - arg_group="Properties", - help="The type of Azure hop the packet should be sent to.", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - - # define Arg Group "RouteParameters" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RoutesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.RoutesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RoutesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_route_read(cls._schema_on_200) - - return cls._schema_on_200 - - class RoutesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_route_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_route_read = None - - @classmethod - def _build_schema_route_read(cls, _schema): - if cls._schema_route_read is not None: - _schema.etag = cls._schema_route_read.etag - _schema.id = cls._schema_route_read.id - _schema.name = cls._schema_route_read.name - _schema.properties = cls._schema_route_read.properties - return - - cls._schema_route_read = _schema_route_read = AAZObjectType() - - route_read = _schema_route_read - route_read.etag = AAZStrType() - route_read.id = AAZStrType() - route_read.name = AAZStrType() - route_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_route_read.etag - _schema.id = cls._schema_route_read.id - _schema.name = cls._schema_route_read.name - _schema.properties = cls._schema_route_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_wait.py deleted file mode 100644 index 75c24655321..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/route_table/route/_wait.py +++ /dev/null @@ -1,191 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Route name.", - required=True, - id_part="child_name_1", - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RoutesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class RoutesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/__cmd_group.py deleted file mode 100644 index 8db8cccf4a5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet", -) -class __CMDGroup(AAZCommandGroup): - """Check if a private IP address is available for use within a virtual network. - - To learn more about Virtual Networks visit https://learn.microsoft.com/azure/virtual-network/virtual-network-manage-network. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_create.py deleted file mode 100644 index ce2f128906c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_create.py +++ /dev/null @@ -1,2141 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet create", -) -class Create(AAZCommand): - """Create a virtual network. - - You may also create a subnet at the same time by specifying a subnet name and (optionally) an address prefix. To learn about how to create a virtual network visit https://learn.microsoft.com/azure/virtual-network/manage-virtual-network#create-a-virtual-network. - - :example: Create a virtual network with a specific address prefix and one subnet. - az network vnet create -g MyResourceGroup -n MyVnet --address-prefix 10.0.0.0/16 --subnet-name MySubnet --subnet-prefixes 10.0.0.0/24 - - :example: Create a virtual network. - az network vnet create --address-prefixes 10.0.0.0/16 --name MyVirtualNetwork --resource-group MyResourceGroup --subnet-name MyAseSubnet --subnet-prefixes 10.0.0.0/24 - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.address_prefixes = AAZListArg( - options=["--address-prefixes"], - help="Space-separated list of IP address prefixes for the VNet. Default: 10.0.0.0/16.", - default=["10.0.0.0/16"], - ) - _args_schema.dns_servers = AAZListArg( - options=["--dns-servers"], - help="Space-separated list of DNS server IP addresses.", - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - address_prefixes = cls._args_schema.address_prefixes - address_prefixes.Element = AAZStrArg() - - dns_servers = cls._args_schema.dns_servers - dns_servers.Element = AAZStrArg() - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - # define Arg Group "Subnet" - - _args_schema = cls._args_schema - _args_schema.subnets = AAZListArg( - options=["--subnets"], - arg_group="Subnet", - help="Manage a list of subnets in a Virtual Network (similar to `az network vnet subnet`).", - ) - - subnets = cls._args_schema.subnets - subnets.Element = AAZObjectArg() - - _element = cls._args_schema.subnets.Element - _element.name = AAZStrArg( - options=["name"], - help="The subnet name.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - _element.network_security_group = AAZObjectArg( - options=["nsg", "network-security-group"], - help="The reference to the NetworkSecurityGroup resource.", - ) - _element.route_table = AAZObjectArg( - options=["route-table"], - help="The reference to the RouteTable resource.", - ) - - network_security_group = cls._args_schema.subnets.Element.network_security_group - network_security_group.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - security_rules = cls._args_schema.subnets.Element.network_security_group.security_rules - security_rules.Element = AAZObjectArg() - - _element = cls._args_schema.subnets.Element.network_security_group.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - - tags = cls._args_schema.subnets.Element.network_security_group.tags - tags.Element = AAZStrArg() - - route_table = cls._args_schema.subnets.Element.route_table - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_schema.subnets.Element.route_table.routes - routes.Element = AAZObjectArg() - - _element = cls._args_schema.subnets.Element.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to.", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - - tags = cls._args_schema.subnets.Element.route_table.tags - tags.Element = AAZStrArg() - return cls._args_schema - - _args_ip_configuration_create = None - - @classmethod - def _build_args_ip_configuration_create(cls, _schema): - if cls._args_ip_configuration_create is not None: - _schema.etag = cls._args_ip_configuration_create.etag - _schema.id = cls._args_ip_configuration_create.id - _schema.name = cls._args_ip_configuration_create.name - _schema.private_ip_address = cls._args_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_create.private_ip_allocation_method - _schema.public_ip_address = cls._args_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_ip_configuration_create.subnet - return - - cls._args_ip_configuration_create = AAZObjectArg() - - ip_configuration_create = cls._args_ip_configuration_create - ip_configuration_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - ip_configuration_create.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - ip_configuration_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - ip_configuration_create.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="The private IP address of the IP configuration.", - ) - ip_configuration_create.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP allocation method. Possible values are 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - ip_configuration_create.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference of the public IP resource.", - ) - cls._build_args_public_ip_address_create(ip_configuration_create.public_ip_address) - ip_configuration_create.subnet = AAZObjectArg( - options=["subnet"], - help="The reference of the subnet resource.", - ) - cls._build_args_subnet_create(ip_configuration_create.subnet) - - _schema.etag = cls._args_ip_configuration_create.etag - _schema.id = cls._args_ip_configuration_create.id - _schema.name = cls._args_ip_configuration_create.name - _schema.private_ip_address = cls._args_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_create.private_ip_allocation_method - _schema.public_ip_address = cls._args_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_ip_configuration_create.subnet - - _args_network_interface_ip_configuration_create = None - - @classmethod - def _build_args_network_interface_ip_configuration_create(cls, _schema): - if cls._args_network_interface_ip_configuration_create is not None: - _schema.etag = cls._args_network_interface_ip_configuration_create.etag - _schema.id = cls._args_network_interface_ip_configuration_create.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_create.name - _schema.primary = cls._args_network_interface_ip_configuration_create.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_create.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_create.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_create.subnet - return - - cls._args_network_interface_ip_configuration_create = AAZObjectArg() - - network_interface_ip_configuration_create = cls._args_network_interface_ip_configuration_create - network_interface_ip_configuration_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_interface_ip_configuration_create.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - network_interface_ip_configuration_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - network_interface_ip_configuration_create.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - ) - network_interface_ip_configuration_create.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - ) - network_interface_ip_configuration_create.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - ) - network_interface_ip_configuration_create.private_ip_address = AAZStrArg( - options=["private-ip-address"], - ) - network_interface_ip_configuration_create.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - network_interface_ip_configuration_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - ) - network_interface_ip_configuration_create.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address resource.", - ) - cls._build_args_public_ip_address_create(network_interface_ip_configuration_create.public_ip_address) - network_interface_ip_configuration_create.subnet = AAZObjectArg( - options=["subnet"], - ) - cls._build_args_subnet_create(network_interface_ip_configuration_create.subnet) - - load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.backend_ip_configurations = AAZListArg( - options=["backend-ip-configurations"], - help="Gets collection of references to IP addresses defined in network interfaces.", - ) - _element.outbound_nat_rule = AAZObjectArg( - options=["outbound-nat-rule"], - help="Gets outbound rules that use this backend address pool.", - ) - cls._build_args_sub_resource_create(_element.outbound_nat_rule) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - backend_ip_configurations = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools.Element.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectArg() - cls._build_args_network_interface_ip_configuration_create(backend_ip_configurations.Element) - - load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.backend_ip_configuration = AAZObjectArg( - options=["backend-ip-configuration"], - help="A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backed IP.", - ) - cls._build_args_network_interface_ip_configuration_create(_element.backend_ip_configuration) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - _schema.etag = cls._args_network_interface_ip_configuration_create.etag - _schema.id = cls._args_network_interface_ip_configuration_create.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_create.name - _schema.primary = cls._args_network_interface_ip_configuration_create.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_create.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_create.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_create.subnet - - _args_network_security_group_create = None - - @classmethod - def _build_args_network_security_group_create(cls, _schema): - if cls._args_network_security_group_create is not None: - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.id = cls._args_network_security_group_create.id - _schema.location = cls._args_network_security_group_create.location - _schema.network_interfaces = cls._args_network_security_group_create.network_interfaces - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.subnets = cls._args_network_security_group_create.subnets - _schema.tags = cls._args_network_security_group_create.tags - return - - cls._args_network_security_group_create = AAZObjectArg() - - network_security_group_create = cls._args_network_security_group_create - network_security_group_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_create.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - network_security_group_create.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - ) - network_security_group_create.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - network_security_group_create.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group_create.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - network_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_network_security_group_create.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_create(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_create.network_interfaces - network_interfaces.Element = AAZObjectArg() - - _element = cls._args_network_security_group_create.network_interfaces.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - ) - _element.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - ) - _element.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - ) - _element.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - ) - _element.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_create(_element.network_security_group) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - ) - _element.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - ) - cls._build_args_sub_resource_create(_element.virtual_machine) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_network_security_group_create.network_interfaces.Element.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - ) - - applied_dns_servers = cls._args_network_security_group_create.network_interfaces.Element.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg() - - dns_servers = cls._args_network_security_group_create.network_interfaces.Element.dns_settings.dns_servers - dns_servers.Element = AAZStrArg() - - ip_configurations = cls._args_network_security_group_create.network_interfaces.Element.ip_configurations - ip_configurations.Element = AAZObjectArg() - cls._build_args_network_interface_ip_configuration_create(ip_configurations.Element) - - tags = cls._args_network_security_group_create.network_interfaces.Element.tags - tags.Element = AAZStrArg() - - security_rules = cls._args_network_security_group_create.security_rules - security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_create(security_rules.Element) - - subnets = cls._args_network_security_group_create.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_create(subnets.Element) - - tags = cls._args_network_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.id = cls._args_network_security_group_create.id - _schema.location = cls._args_network_security_group_create.location - _schema.network_interfaces = cls._args_network_security_group_create.network_interfaces - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.subnets = cls._args_network_security_group_create.subnets - _schema.tags = cls._args_network_security_group_create.tags - - _args_public_ip_address_create = None - - @classmethod - def _build_args_public_ip_address_create(cls, _schema): - if cls._args_public_ip_address_create is not None: - _schema.dns_settings = cls._args_public_ip_address_create.dns_settings - _schema.etag = cls._args_public_ip_address_create.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_create.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_create.ip_address - _schema.ip_configuration = cls._args_public_ip_address_create.ip_configuration - _schema.location = cls._args_public_ip_address_create.location - _schema.provisioning_state = cls._args_public_ip_address_create.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_create.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_create.resource_guid - _schema.tags = cls._args_public_ip_address_create.tags - return - - cls._args_public_ip_address_create = AAZObjectArg() - - public_ip_address_create = cls._args_public_ip_address_create - public_ip_address_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - public_ip_address_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_create.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - ) - public_ip_address_create.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - ) - public_ip_address_create.ip_address = AAZStrArg( - options=["ip-address"], - ) - public_ip_address_create.ip_configuration = AAZObjectArg( - options=["ip-configuration"], - help="IPConfiguration", - ) - cls._build_args_ip_configuration_create(public_ip_address_create.ip_configuration) - public_ip_address_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - public_ip_address_create.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_create.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - ) - public_ip_address_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_public_ip_address_create.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - ) - - tags = cls._args_public_ip_address_create.tags - tags.Element = AAZStrArg() - - _schema.dns_settings = cls._args_public_ip_address_create.dns_settings - _schema.etag = cls._args_public_ip_address_create.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_create.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_create.ip_address - _schema.ip_configuration = cls._args_public_ip_address_create.ip_configuration - _schema.location = cls._args_public_ip_address_create.location - _schema.provisioning_state = cls._args_public_ip_address_create.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_create.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_create.resource_guid - _schema.tags = cls._args_public_ip_address_create.tags - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_port_range = cls._args_security_rule_create.source_port_range - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_port_range = cls._args_security_rule_create.source_port_range - - _args_sub_resource_create = None - - @classmethod - def _build_args_sub_resource_create(cls, _schema): - if cls._args_sub_resource_create is not None: - _schema.id = cls._args_sub_resource_create.id - return - - cls._args_sub_resource_create = AAZObjectArg() - - sub_resource_create = cls._args_sub_resource_create - sub_resource_create.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - - _schema.id = cls._args_sub_resource_create.id - - _args_subnet_create = None - - @classmethod - def _build_args_subnet_create(cls, _schema): - if cls._args_subnet_create is not None: - _schema.address_prefix = cls._args_subnet_create.address_prefix - _schema.etag = cls._args_subnet_create.etag - _schema.ip_configurations = cls._args_subnet_create.ip_configurations - _schema.name = cls._args_subnet_create.name - _schema.network_security_group = cls._args_subnet_create.network_security_group - _schema.route_table = cls._args_subnet_create.route_table - return - - cls._args_subnet_create = AAZObjectArg() - - subnet_create = cls._args_subnet_create - subnet_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - subnet_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - subnet_create.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - subnet_create.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="Gets an array of references to the network interface IP configurations using subnet.", - ) - subnet_create.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_create(subnet_create.network_security_group) - subnet_create.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - ) - - ip_configurations = cls._args_subnet_create.ip_configurations - ip_configurations.Element = AAZObjectArg() - cls._build_args_ip_configuration_create(ip_configurations.Element) - - route_table = cls._args_subnet_create.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_subnet_create.route_table.routes - routes.Element = AAZObjectArg() - - _element = cls._args_subnet_create.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - subnets = cls._args_subnet_create.route_table.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_create(subnets.Element) - - tags = cls._args_subnet_create.route_table.tags - tags.Element = AAZStrArg() - - _schema.address_prefix = cls._args_subnet_create.address_prefix - _schema.etag = cls._args_subnet_create.etag - _schema.ip_configurations = cls._args_subnet_create.ip_configurations - _schema.name = cls._args_subnet_create.name - _schema.network_security_group = cls._args_subnet_create.network_security_group - _schema.route_table = cls._args_subnet_create.route_table - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworksCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworksCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressSpace", AAZObjectType) - properties.set_prop("dhcpOptions", AAZObjectType) - properties.set_prop("subnets", AAZListType, ".subnets") - - address_space = _builder.get(".properties.addressSpace") - if address_space is not None: - address_space.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".properties.addressSpace.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - dhcp_options = _builder.get(".properties.dhcpOptions") - if dhcp_options is not None: - dhcp_options.set_prop("dnsServers", AAZListType, ".dns_servers") - - dns_servers = _builder.get(".properties.dhcpOptions.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - subnets.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.subnets[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.subnets[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - network_security_group = _builder.get(".properties.subnets[].properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("id", AAZStrType, ".id") - network_security_group.set_prop("location", AAZStrType, ".location") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - network_security_group.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties") - if properties is not None: - properties.set_prop("securityRules", AAZListType, ".security_rules") - - security_rules = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - tags = _builder.get(".properties.subnets[].properties.networkSecurityGroup.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - route_table = _builder.get(".properties.subnets[].properties.routeTable") - if route_table is not None: - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.subnets[].properties.routeTable.properties") - if properties is not None: - properties.set_prop("routes", AAZListType, ".routes") - - routes = _builder.get(".properties.subnets[].properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.subnets[].properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.subnets[].properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - - tags = _builder.get(".properties.subnets[].properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.location = AAZStrType() - _schema_on_200_201.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200_201.tags = AAZDictType() - _schema_on_200_201.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - - address_space = cls._schema_on_200_201.properties.address_space - address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200_201.properties.address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - dhcp_options = cls._schema_on_200_201.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = cls._schema_on_200_201.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = cls._schema_on_200_201.properties.subnets - subnets.Element = AAZObjectType() - _CreateHelper._build_schema_subnet_read(subnets.Element) - - tags = cls._schema_on_200_201.tags - tags.Element = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_ip_configuration_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - cls._build_schema_public_ip_address_create(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_create(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - @classmethod - def _build_schema_network_interface_ip_configuration_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_create(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_create(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("backendIPConfigurations", AAZListType, ".backend_ip_configurations") - cls._build_schema_sub_resource_create(properties.set_prop("outboundNatRule", AAZObjectType, ".outbound_nat_rule")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - backend_ip_configurations = _builder.get(".properties.loadBalancerBackendAddressPools[].properties.backendIPConfigurations") - if backend_ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_create(backend_ip_configurations.set_elements(AAZObjectType, ".")) - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - cls._build_schema_network_interface_ip_configuration_create(properties.set_prop("backendIPConfiguration", AAZObjectType, ".backend_ip_configuration")) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_network_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_create(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - network_interfaces.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkInterfaces[].properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - cls._build_schema_network_security_group_create(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_create(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.networkInterfaces[].properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_create(ip_configurations.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkInterfaces[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - cls._build_schema_security_rule_create(security_rules.set_elements(AAZObjectType, ".")) - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_create(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - cls._build_schema_ip_configuration_create(properties.set_prop("ipConfiguration", AAZObjectType, ".ip_configuration")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - cls._build_schema_network_security_group_create(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_ip_configuration_create(ip_configurations.set_elements(AAZObjectType, ".")) - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_create(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_delete.py deleted file mode 100644 index 82e86377e21..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet delete", -) -class Delete(AAZCommand): - """Delete a virtual network. - - :example: Delete a virtual network. - az network vnet delete -g MyResourceGroup -n myVNet - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworksDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class VirtualNetworksDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_list.py deleted file mode 100644 index a61226cf7fc..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_list.py +++ /dev/null @@ -1,920 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet list", -) -class List(AAZCommand): - """List virtual networks. - - :example: List all virtual networks in a subscription. - az network vnet list - - :example: List all virtual networks in a resource group. - az network vnet list -g MyResourceGroup - - :example: List virtual networks in a subscription which specify a certain address prefix. - az network vnet list --query "[?contains(addressSpace.addressPrefixes, '10.0.0.0/16')]" - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/virtualnetworks", "2015-06-15"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.VirtualNetworksList(ctx=self.ctx)() - if condition_1: - self.VirtualNetworksListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class VirtualNetworksList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - - address_space = cls._schema_on_200.value.Element.properties.address_space - address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.value.Element.properties.address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - dhcp_options = cls._schema_on_200.value.Element.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = cls._schema_on_200.value.Element.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = cls._schema_on_200.value.Element.properties.subnets - subnets.Element = AAZObjectType() - _ListHelper._build_schema_subnet_read(subnets.Element) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - class VirtualNetworksListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualnetworks", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - - address_space = cls._schema_on_200.value.Element.properties.address_space - address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.value.Element.properties.address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - dhcp_options = cls._schema_on_200.value.Element.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = cls._schema_on_200.value.Element.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = cls._schema_on_200.value.Element.properties.subnets - subnets.Element = AAZObjectType() - _ListHelper._build_schema_subnet_read(subnets.Element) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_show.py deleted file mode 100644 index 259aa661e03..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_show.py +++ /dev/null @@ -1,782 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet show", -) -class Show(AAZCommand): - """Get the details of a virtual network. - - :example: Get details for MyVNet. - az network vnet show -g MyResourceGroup -n MyVNet - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworksGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworksGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - - address_space = cls._schema_on_200.properties.address_space - address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - dhcp_options = cls._schema_on_200.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = cls._schema_on_200.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = cls._schema_on_200.properties.subnets - subnets.Element = AAZObjectType() - _ShowHelper._build_schema_subnet_read(subnets.Element) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_update.py deleted file mode 100644 index ca03350e319..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_update.py +++ /dev/null @@ -1,2241 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet update", -) -class Update(AAZCommand): - """Update a virtual network. - - :example: Update a virtual network with the IP address of a DNS server. - az network vnet update -g MyResourceGroup -n MyVNet --dns-servers 10.2.0.8 - - :example: Update a virtual network. - az network vnet update --address-prefixes 40.1.0.0/24 --name MyVNet --resource-group MyResourceGroup - - :example: Update a virtual network to delete DNS server. - az network vnet update -g MyResourceGroup -n MyVNet --dns-servers null - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.address_prefixes = AAZListArg( - options=["--address-prefixes"], - help="Space-separated list of IP address prefixes for the VNet.", - nullable=True, - ) - _args_schema.dns_servers = AAZListArg( - options=["--dns-servers"], - help="Space-separated list of DNS server IP addresses.", - nullable=True, - ) - - address_prefixes = cls._args_schema.address_prefixes - address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - dns_servers = cls._args_schema.dns_servers - dns_servers.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - return cls._args_schema - - _args_ip_configuration_update = None - - @classmethod - def _build_args_ip_configuration_update(cls, _schema): - if cls._args_ip_configuration_update is not None: - _schema.etag = cls._args_ip_configuration_update.etag - _schema.id = cls._args_ip_configuration_update.id - _schema.name = cls._args_ip_configuration_update.name - _schema.private_ip_address = cls._args_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_update.private_ip_allocation_method - _schema.public_ip_address = cls._args_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_ip_configuration_update.subnet - return - - cls._args_ip_configuration_update = AAZObjectArg( - nullable=True, - ) - - ip_configuration_update = cls._args_ip_configuration_update - ip_configuration_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - ip_configuration_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - ip_configuration_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - ip_configuration_update.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="The private IP address of the IP configuration.", - nullable=True, - ) - ip_configuration_update.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP allocation method. Possible values are 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - ip_configuration_update.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference of the public IP resource.", - nullable=True, - ) - cls._build_args_public_ip_address_update(ip_configuration_update.public_ip_address) - ip_configuration_update.subnet = AAZObjectArg( - options=["subnet"], - help="The reference of the subnet resource.", - nullable=True, - ) - cls._build_args_subnet_update(ip_configuration_update.subnet) - - _schema.etag = cls._args_ip_configuration_update.etag - _schema.id = cls._args_ip_configuration_update.id - _schema.name = cls._args_ip_configuration_update.name - _schema.private_ip_address = cls._args_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_update.private_ip_allocation_method - _schema.public_ip_address = cls._args_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_ip_configuration_update.subnet - - _args_network_interface_ip_configuration_update = None - - @classmethod - def _build_args_network_interface_ip_configuration_update(cls, _schema): - if cls._args_network_interface_ip_configuration_update is not None: - _schema.etag = cls._args_network_interface_ip_configuration_update.etag - _schema.id = cls._args_network_interface_ip_configuration_update.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_update.name - _schema.primary = cls._args_network_interface_ip_configuration_update.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_update.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_update.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_update.subnet - return - - cls._args_network_interface_ip_configuration_update = AAZObjectArg( - nullable=True, - ) - - network_interface_ip_configuration_update = cls._args_network_interface_ip_configuration_update - network_interface_ip_configuration_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_interface_ip_configuration_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - network_interface_ip_configuration_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - network_interface_ip_configuration_update.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - nullable=True, - ) - network_interface_ip_configuration_update.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - nullable=True, - ) - network_interface_ip_configuration_update.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - nullable=True, - ) - network_interface_ip_configuration_update.private_ip_address = AAZStrArg( - options=["private-ip-address"], - nullable=True, - ) - network_interface_ip_configuration_update.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - network_interface_ip_configuration_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - nullable=True, - ) - network_interface_ip_configuration_update.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address resource.", - nullable=True, - ) - cls._build_args_public_ip_address_update(network_interface_ip_configuration_update.public_ip_address) - network_interface_ip_configuration_update.subnet = AAZObjectArg( - options=["subnet"], - nullable=True, - ) - cls._build_args_subnet_update(network_interface_ip_configuration_update.subnet) - - load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.backend_ip_configurations = AAZListArg( - options=["backend-ip-configurations"], - help="Gets collection of references to IP addresses defined in network interfaces.", - nullable=True, - ) - _element.outbound_nat_rule = AAZObjectArg( - options=["outbound-nat-rule"], - help="Gets outbound rules that use this backend address pool.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.outbound_nat_rule) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - backend_ip_configurations = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools.Element.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_network_interface_ip_configuration_update(backend_ip_configurations.Element) - - load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.backend_ip_configuration = AAZObjectArg( - options=["backend-ip-configuration"], - help="A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backed IP.", - nullable=True, - ) - cls._build_args_network_interface_ip_configuration_update(_element.backend_ip_configuration) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - nullable=True, - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - nullable=True, - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - nullable=True, - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - _schema.etag = cls._args_network_interface_ip_configuration_update.etag - _schema.id = cls._args_network_interface_ip_configuration_update.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_update.name - _schema.primary = cls._args_network_interface_ip_configuration_update.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_update.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_update.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_update.subnet - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg( - nullable=True, - ) - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - network_security_group_update.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - nullable=True, - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - network_security_group_update.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_update.network_interfaces - network_interfaces.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.network_interfaces.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - nullable=True, - ) - _element.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - nullable=True, - ) - _element.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - nullable=True, - ) - _element.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - nullable=True, - ) - _element.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(_element.network_security_group) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - nullable=True, - ) - _element.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.virtual_machine) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_network_security_group_update.network_interfaces.Element.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - nullable=True, - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - nullable=True, - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - nullable=True, - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - nullable=True, - ) - - applied_dns_servers = cls._args_network_security_group_update.network_interfaces.Element.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg( - nullable=True, - ) - - dns_servers = cls._args_network_security_group_update.network_interfaces.Element.dns_settings.dns_servers - dns_servers.Element = AAZStrArg( - nullable=True, - ) - - ip_configurations = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_network_interface_ip_configuration_update(ip_configurations.Element) - - tags = cls._args_network_security_group_update.network_interfaces.Element.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - - subnets = cls._args_network_security_group_update.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - - _args_public_ip_address_update = None - - @classmethod - def _build_args_public_ip_address_update(cls, _schema): - if cls._args_public_ip_address_update is not None: - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.ip_configuration = cls._args_public_ip_address_update.ip_configuration - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.tags = cls._args_public_ip_address_update.tags - return - - cls._args_public_ip_address_update = AAZObjectArg( - nullable=True, - ) - - public_ip_address_update = cls._args_public_ip_address_update - public_ip_address_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - public_ip_address_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_update.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - nullable=True, - ) - public_ip_address_update.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - nullable=True, - ) - public_ip_address_update.ip_address = AAZStrArg( - options=["ip-address"], - nullable=True, - ) - public_ip_address_update.ip_configuration = AAZObjectArg( - options=["ip-configuration"], - help="IPConfiguration", - nullable=True, - ) - cls._build_args_ip_configuration_update(public_ip_address_update.ip_configuration) - public_ip_address_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - public_ip_address_update.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - nullable=True, - ) - public_ip_address_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_public_ip_address_update.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - nullable=True, - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - nullable=True, - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - nullable=True, - ) - - tags = cls._args_public_ip_address_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.ip_configuration = cls._args_public_ip_address_update.ip_configuration - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.tags = cls._args_public_ip_address_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_subnet_update = None - - @classmethod - def _build_args_subnet_update(cls, _schema): - if cls._args_subnet_update is not None: - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.ip_configurations = cls._args_subnet_update.ip_configurations - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.route_table = cls._args_subnet_update.route_table - return - - cls._args_subnet_update = AAZObjectArg( - nullable=True, - ) - - subnet_update = cls._args_subnet_update - subnet_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - subnet_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - subnet_update.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - nullable=True, - ) - subnet_update.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="Gets an array of references to the network interface IP configurations using subnet.", - nullable=True, - ) - subnet_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(subnet_update.network_security_group) - subnet_update.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - nullable=True, - ) - - ip_configurations = cls._args_subnet_update.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_ip_configuration_update(ip_configurations.Element) - - route_table = cls._args_subnet_update.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - nullable=True, - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - routes = cls._args_subnet_update.route_table.routes - routes.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - nullable=True, - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - nullable=True, - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - subnets = cls._args_subnet_update.route_table.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_subnet_update.route_table.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.ip_configurations = cls._args_subnet_update.ip_configurations - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.route_table = cls._args_subnet_update.route_table - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworksGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.VirtualNetworksCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworksGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworksCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressSpace", AAZObjectType) - properties.set_prop("dhcpOptions", AAZObjectType) - - address_space = _builder.get(".properties.addressSpace") - if address_space is not None: - address_space.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".properties.addressSpace.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - dhcp_options = _builder.get(".properties.dhcpOptions") - if dhcp_options is not None: - dhcp_options.set_prop("dnsServers", AAZListType, ".dns_servers") - - dns_servers = _builder.get(".properties.dhcpOptions.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_ip_configuration_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - @classmethod - def _build_schema_network_interface_ip_configuration_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("backendIPConfigurations", AAZListType, ".backend_ip_configurations") - cls._build_schema_sub_resource_update(properties.set_prop("outboundNatRule", AAZObjectType, ".outbound_nat_rule")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - backend_ip_configurations = _builder.get(".properties.loadBalancerBackendAddressPools[].properties.backendIPConfigurations") - if backend_ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_update(backend_ip_configurations.set_elements(AAZObjectType, ".")) - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - cls._build_schema_network_interface_ip_configuration_update(properties.set_prop("backendIPConfiguration", AAZObjectType, ".backend_ip_configuration")) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_update(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - network_interfaces.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkInterfaces[].properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_update(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.networkInterfaces[].properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_update(ip_configurations.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkInterfaces[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - cls._build_schema_ip_configuration_update(properties.set_prop("ipConfiguration", AAZObjectType, ".ip_configuration")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_ip_configuration_update(ip_configurations.set_elements(AAZObjectType, ".")) - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_read = None - - @classmethod - def _build_schema_virtual_network_read(cls, _schema): - if cls._schema_virtual_network_read is not None: - _schema.etag = cls._schema_virtual_network_read.etag - _schema.id = cls._schema_virtual_network_read.id - _schema.location = cls._schema_virtual_network_read.location - _schema.name = cls._schema_virtual_network_read.name - _schema.properties = cls._schema_virtual_network_read.properties - _schema.tags = cls._schema_virtual_network_read.tags - _schema.type = cls._schema_virtual_network_read.type - return - - cls._schema_virtual_network_read = _schema_virtual_network_read = AAZObjectType() - - virtual_network_read = _schema_virtual_network_read - virtual_network_read.etag = AAZStrType() - virtual_network_read.id = AAZStrType() - virtual_network_read.location = AAZStrType() - virtual_network_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_read.tags = AAZDictType() - virtual_network_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_read.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - - address_space = _schema_virtual_network_read.properties.address_space - address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_read.properties.address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - dhcp_options = _schema_virtual_network_read.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = _schema_virtual_network_read.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = _schema_virtual_network_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_virtual_network_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_read.etag - _schema.id = cls._schema_virtual_network_read.id - _schema.location = cls._schema_virtual_network_read.location - _schema.name = cls._schema_virtual_network_read.name - _schema.properties = cls._schema_virtual_network_read.properties - _schema.tags = cls._schema_virtual_network_read.tags - _schema.type = cls._schema_virtual_network_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_wait.py deleted file mode 100644 index 123a8f78082..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/_wait.py +++ /dev/null @@ -1,778 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworksGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworksGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - - address_space = cls._schema_on_200.properties.address_space - address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - dhcp_options = cls._schema_on_200.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = cls._schema_on_200.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = cls._schema_on_200.properties.subnets - subnets.Element = AAZObjectType() - _WaitHelper._build_schema_subnet_read(subnets.Element) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/__cmd_group.py deleted file mode 100644 index 7d97ad0f39f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet subnet", -) -class __CMDGroup(AAZCommandGroup): - """Manage subnets in an Azure Virtual Network. - - To learn more about subnets visit https://learn.microsoft.com/azure/virtual-network/virtual-network-manage-subnet. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_create.py deleted file mode 100644 index 9264d09662a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_create.py +++ /dev/null @@ -1,1813 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet create", -) -class Create(AAZCommand): - """Create a subnet and associate an existing NSG and route table. - - :example: Create new subnet attached to an NSG with a custom route table. - az network vnet subnet create -g MyResourceGroup --vnet-name MyVnet -n MySubnet --address-prefixes 10.0.0.0/24 --network-security-group MyNsg --route-table MyRouteTable - - :example: Create new subnet attached to a NAT gateway. - az network vnet subnet create -n MySubnet --vnet-name MyVnet -g MyResourceGroup --nat-gateway MyNatGateway --address-prefixes "10.0.0.0/21" - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The subnet name.", - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - ) - _args_schema.address_prefix = AAZStrArg( - options=["--address-prefix"], - help="The address prefix for the subnet.", - ) - _args_schema.network_security_group = AAZResourceIdArg( - options=["--nsg", "--network-security-group"], - help="Name or ID of a network security group (NSG).", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - _args_schema.route_table = AAZResourceIdArg( - options=["--route-table"], - help="Name or ID of a route table to associate with the subnet.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - - # define Arg Group "NetworkSecurityGroup" - - # define Arg Group "Properties" - - # define Arg Group "RouteTable" - - # define Arg Group "SubnetParameters" - return cls._args_schema - - _args_ip_configuration_create = None - - @classmethod - def _build_args_ip_configuration_create(cls, _schema): - if cls._args_ip_configuration_create is not None: - _schema.etag = cls._args_ip_configuration_create.etag - _schema.id = cls._args_ip_configuration_create.id - _schema.name = cls._args_ip_configuration_create.name - _schema.private_ip_address = cls._args_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_create.private_ip_allocation_method - _schema.public_ip_address = cls._args_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_ip_configuration_create.subnet - return - - cls._args_ip_configuration_create = AAZObjectArg() - - ip_configuration_create = cls._args_ip_configuration_create - ip_configuration_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - ip_configuration_create.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - ip_configuration_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - ip_configuration_create.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="The private IP address of the IP configuration.", - ) - ip_configuration_create.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP allocation method. Possible values are 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - ip_configuration_create.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference of the public IP resource.", - ) - cls._build_args_public_ip_address_create(ip_configuration_create.public_ip_address) - ip_configuration_create.subnet = AAZObjectArg( - options=["subnet"], - help="The reference of the subnet resource.", - ) - cls._build_args_subnet_create(ip_configuration_create.subnet) - - _schema.etag = cls._args_ip_configuration_create.etag - _schema.id = cls._args_ip_configuration_create.id - _schema.name = cls._args_ip_configuration_create.name - _schema.private_ip_address = cls._args_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_create.private_ip_allocation_method - _schema.public_ip_address = cls._args_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_ip_configuration_create.subnet - - _args_network_interface_ip_configuration_create = None - - @classmethod - def _build_args_network_interface_ip_configuration_create(cls, _schema): - if cls._args_network_interface_ip_configuration_create is not None: - _schema.etag = cls._args_network_interface_ip_configuration_create.etag - _schema.id = cls._args_network_interface_ip_configuration_create.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_create.name - _schema.primary = cls._args_network_interface_ip_configuration_create.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_create.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_create.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_create.subnet - return - - cls._args_network_interface_ip_configuration_create = AAZObjectArg() - - network_interface_ip_configuration_create = cls._args_network_interface_ip_configuration_create - network_interface_ip_configuration_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_interface_ip_configuration_create.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - network_interface_ip_configuration_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - network_interface_ip_configuration_create.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - ) - network_interface_ip_configuration_create.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - ) - network_interface_ip_configuration_create.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - ) - network_interface_ip_configuration_create.private_ip_address = AAZStrArg( - options=["private-ip-address"], - ) - network_interface_ip_configuration_create.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - network_interface_ip_configuration_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - ) - network_interface_ip_configuration_create.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address resource.", - ) - cls._build_args_public_ip_address_create(network_interface_ip_configuration_create.public_ip_address) - network_interface_ip_configuration_create.subnet = AAZObjectArg( - options=["subnet"], - ) - cls._build_args_subnet_create(network_interface_ip_configuration_create.subnet) - - load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.backend_ip_configurations = AAZListArg( - options=["backend-ip-configurations"], - help="Gets collection of references to IP addresses defined in network interfaces.", - ) - _element.outbound_nat_rule = AAZObjectArg( - options=["outbound-nat-rule"], - help="Gets outbound rules that use this backend address pool.", - ) - cls._build_args_sub_resource_create(_element.outbound_nat_rule) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - backend_ip_configurations = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools.Element.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectArg() - cls._build_args_network_interface_ip_configuration_create(backend_ip_configurations.Element) - - load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.backend_ip_configuration = AAZObjectArg( - options=["backend-ip-configuration"], - help="A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backed IP.", - ) - cls._build_args_network_interface_ip_configuration_create(_element.backend_ip_configuration) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - _schema.etag = cls._args_network_interface_ip_configuration_create.etag - _schema.id = cls._args_network_interface_ip_configuration_create.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_create.name - _schema.primary = cls._args_network_interface_ip_configuration_create.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_create.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_create.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_create.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_create.subnet - - _args_network_security_group_create = None - - @classmethod - def _build_args_network_security_group_create(cls, _schema): - if cls._args_network_security_group_create is not None: - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.id = cls._args_network_security_group_create.id - _schema.location = cls._args_network_security_group_create.location - _schema.network_interfaces = cls._args_network_security_group_create.network_interfaces - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.subnets = cls._args_network_security_group_create.subnets - _schema.tags = cls._args_network_security_group_create.tags - return - - cls._args_network_security_group_create = AAZObjectArg() - - network_security_group_create = cls._args_network_security_group_create - network_security_group_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_create.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - network_security_group_create.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - ) - network_security_group_create.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - network_security_group_create.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group_create.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - network_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_network_security_group_create.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_create(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_create.network_interfaces - network_interfaces.Element = AAZObjectArg() - - _element = cls._args_network_security_group_create.network_interfaces.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - ) - _element.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - ) - _element.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - ) - _element.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - ) - _element.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_create(_element.network_security_group) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - ) - _element.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - ) - cls._build_args_sub_resource_create(_element.virtual_machine) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_network_security_group_create.network_interfaces.Element.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - ) - - applied_dns_servers = cls._args_network_security_group_create.network_interfaces.Element.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg() - - dns_servers = cls._args_network_security_group_create.network_interfaces.Element.dns_settings.dns_servers - dns_servers.Element = AAZStrArg() - - ip_configurations = cls._args_network_security_group_create.network_interfaces.Element.ip_configurations - ip_configurations.Element = AAZObjectArg() - cls._build_args_network_interface_ip_configuration_create(ip_configurations.Element) - - tags = cls._args_network_security_group_create.network_interfaces.Element.tags - tags.Element = AAZStrArg() - - security_rules = cls._args_network_security_group_create.security_rules - security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_create(security_rules.Element) - - subnets = cls._args_network_security_group_create.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_create(subnets.Element) - - tags = cls._args_network_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.id = cls._args_network_security_group_create.id - _schema.location = cls._args_network_security_group_create.location - _schema.network_interfaces = cls._args_network_security_group_create.network_interfaces - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.subnets = cls._args_network_security_group_create.subnets - _schema.tags = cls._args_network_security_group_create.tags - - _args_public_ip_address_create = None - - @classmethod - def _build_args_public_ip_address_create(cls, _schema): - if cls._args_public_ip_address_create is not None: - _schema.dns_settings = cls._args_public_ip_address_create.dns_settings - _schema.etag = cls._args_public_ip_address_create.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_create.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_create.ip_address - _schema.ip_configuration = cls._args_public_ip_address_create.ip_configuration - _schema.location = cls._args_public_ip_address_create.location - _schema.provisioning_state = cls._args_public_ip_address_create.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_create.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_create.resource_guid - _schema.tags = cls._args_public_ip_address_create.tags - return - - cls._args_public_ip_address_create = AAZObjectArg() - - public_ip_address_create = cls._args_public_ip_address_create - public_ip_address_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - public_ip_address_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_create.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - ) - public_ip_address_create.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - ) - public_ip_address_create.ip_address = AAZStrArg( - options=["ip-address"], - ) - public_ip_address_create.ip_configuration = AAZObjectArg( - options=["ip-configuration"], - help="IPConfiguration", - ) - cls._build_args_ip_configuration_create(public_ip_address_create.ip_configuration) - public_ip_address_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - public_ip_address_create.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_create.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - ) - public_ip_address_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - dns_settings = cls._args_public_ip_address_create.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - ) - - tags = cls._args_public_ip_address_create.tags - tags.Element = AAZStrArg() - - _schema.dns_settings = cls._args_public_ip_address_create.dns_settings - _schema.etag = cls._args_public_ip_address_create.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_create.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_create.ip_address - _schema.ip_configuration = cls._args_public_ip_address_create.ip_configuration - _schema.location = cls._args_public_ip_address_create.location - _schema.provisioning_state = cls._args_public_ip_address_create.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_create.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_create.resource_guid - _schema.tags = cls._args_public_ip_address_create.tags - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_port_range = cls._args_security_rule_create.source_port_range - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_port_range = cls._args_security_rule_create.source_port_range - - _args_sub_resource_create = None - - @classmethod - def _build_args_sub_resource_create(cls, _schema): - if cls._args_sub_resource_create is not None: - _schema.id = cls._args_sub_resource_create.id - return - - cls._args_sub_resource_create = AAZObjectArg() - - sub_resource_create = cls._args_sub_resource_create - sub_resource_create.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - ) - - _schema.id = cls._args_sub_resource_create.id - - _args_subnet_create = None - - @classmethod - def _build_args_subnet_create(cls, _schema): - if cls._args_subnet_create is not None: - _schema.address_prefix = cls._args_subnet_create.address_prefix - _schema.etag = cls._args_subnet_create.etag - _schema.ip_configurations = cls._args_subnet_create.ip_configurations - _schema.name = cls._args_subnet_create.name - _schema.network_security_group = cls._args_subnet_create.network_security_group - _schema.route_table = cls._args_subnet_create.route_table - return - - cls._args_subnet_create = AAZObjectArg() - - subnet_create = cls._args_subnet_create - subnet_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - subnet_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - subnet_create.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - subnet_create.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="Gets an array of references to the network interface IP configurations using subnet.", - ) - subnet_create.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_create(subnet_create.network_security_group) - subnet_create.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - ) - - ip_configurations = cls._args_subnet_create.ip_configurations - ip_configurations.Element = AAZObjectArg() - cls._build_args_ip_configuration_create(ip_configurations.Element) - - route_table = cls._args_subnet_create.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_subnet_create.route_table.routes - routes.Element = AAZObjectArg() - - _element = cls._args_subnet_create.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - subnets = cls._args_subnet_create.route_table.subnets - subnets.Element = AAZObjectArg() - cls._build_args_subnet_create(subnets.Element) - - tags = cls._args_subnet_create.route_table.tags - tags.Element = AAZStrArg() - - _schema.address_prefix = cls._args_subnet_create.address_prefix - _schema.etag = cls._args_subnet_create.etag - _schema.ip_configurations = cls._args_subnet_create.ip_configurations - _schema.name = cls._args_subnet_create.name - _schema.network_security_group = cls._args_subnet_create.network_security_group - _schema.route_table = cls._args_subnet_create.route_table - - def _execute_operations(self): - self.pre_operations() - yield self.SubnetsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SubnetsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("networkSecurityGroup", AAZObjectType) - properties.set_prop("routeTable", AAZObjectType) - - network_security_group = _builder.get(".properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("id", AAZStrType, ".network_security_group") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("id", AAZStrType, ".route_table") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_subnet_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_ip_configuration_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - cls._build_schema_public_ip_address_create(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_create(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - @classmethod - def _build_schema_network_interface_ip_configuration_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_create(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_create(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("backendIPConfigurations", AAZListType, ".backend_ip_configurations") - cls._build_schema_sub_resource_create(properties.set_prop("outboundNatRule", AAZObjectType, ".outbound_nat_rule")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - backend_ip_configurations = _builder.get(".properties.loadBalancerBackendAddressPools[].properties.backendIPConfigurations") - if backend_ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_create(backend_ip_configurations.set_elements(AAZObjectType, ".")) - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - cls._build_schema_network_interface_ip_configuration_create(properties.set_prop("backendIPConfiguration", AAZObjectType, ".backend_ip_configuration")) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_network_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_create(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - network_interfaces.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkInterfaces[].properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - cls._build_schema_network_security_group_create(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_create(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.networkInterfaces[].properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_create(ip_configurations.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkInterfaces[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - cls._build_schema_security_rule_create(security_rules.set_elements(AAZObjectType, ".")) - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_create(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - cls._build_schema_ip_configuration_create(properties.set_prop("ipConfiguration", AAZObjectType, ".ip_configuration")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - cls._build_schema_network_security_group_create(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_ip_configuration_create(ip_configurations.set_elements(AAZObjectType, ".")) - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_create(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_delete.py deleted file mode 100644 index 23577035d88..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_delete.py +++ /dev/null @@ -1,172 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet delete", -) -class Delete(AAZCommand): - """Delete a subnet. - - :example: Delete a subnet. - az network vnet subnet delete --name MySubnet --resource-group MyResourceGroup --vnet-name MyVnet - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The subnet name.", - required=True, - id_part="child_name_1", - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.SubnetsDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class SubnetsDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_list.py deleted file mode 100644 index 4609f4b0a45..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_list.py +++ /dev/null @@ -1,731 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet list", -) -class List(AAZCommand): - """List the subnets in a virtual network. - - :example: List the subnets in a virtual network. - az network vnet subnet list -g MyResourceGroup --vnet-name MyVNet - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SubnetsList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class SubnetsList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_subnet_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_show.py deleted file mode 100644 index acbc8e2b4aa..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_show.py +++ /dev/null @@ -1,740 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet show", -) -class Show(AAZCommand): - """Show details of a subnet. - - :example: Show the details of a subnet associated with a virtual network. - az network vnet subnet show -g MyResourceGroup -n MySubnet --vnet-name MyVNet - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The subnet name.", - required=True, - id_part="child_name_1", - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SubnetsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SubnetsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_subnet_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_update.py deleted file mode 100644 index df31c8403fa..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_update.py +++ /dev/null @@ -1,2182 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet update", -) -class Update(AAZCommand): - """Update a subnet. - - :example: Associate a network security group to a subnet. - az network vnet subnet update -g MyResourceGroup -n MySubnet --vnet-name MyVNet --network-security-group MyNsg - - :example: Update subnet with NAT gateway. - az network vnet subnet update -n MySubnet --vnet-name MyVnet -g MyResourceGroup --nat-gateway MyNatGateway --address-prefixes "10.0.0.0/21" - - :example: Disable the private endpoint network policies - az network vnet subnet update -n MySubnet --vnet-name MyVnet -g MyResourceGroup --disable-private-endpoint-network-policies - - :example: Detach a network security group in a subnet. - az network vnet subnet update -g MyResourceGroup --vnet-name MyVNet -n MySubnet --nsg null - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The subnet name.", - required=True, - id_part="child_name_1", - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.address_prefix = AAZStrArg( - options=["--address-prefix"], - help="The address prefix for the subnet.", - nullable=True, - ) - _args_schema.network_security_group = AAZResourceIdArg( - options=["--nsg", "--network-security-group"], - help="Name or ID of a network security group (NSG). Use null to detach it.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - _args_schema.route_table = AAZResourceIdArg( - options=["--route-table"], - help="Name or ID of a route table to associate with the subnet. Use null to detach it.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - - # define Arg Group "NetworkSecurityGroup" - - # define Arg Group "Properties" - - # define Arg Group "RouteTable" - - # define Arg Group "SubnetParameters" - return cls._args_schema - - _args_ip_configuration_update = None - - @classmethod - def _build_args_ip_configuration_update(cls, _schema): - if cls._args_ip_configuration_update is not None: - _schema.etag = cls._args_ip_configuration_update.etag - _schema.id = cls._args_ip_configuration_update.id - _schema.name = cls._args_ip_configuration_update.name - _schema.private_ip_address = cls._args_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_update.private_ip_allocation_method - _schema.public_ip_address = cls._args_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_ip_configuration_update.subnet - return - - cls._args_ip_configuration_update = AAZObjectArg( - nullable=True, - ) - - ip_configuration_update = cls._args_ip_configuration_update - ip_configuration_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - ip_configuration_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - ip_configuration_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - ip_configuration_update.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="The private IP address of the IP configuration.", - nullable=True, - ) - ip_configuration_update.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP allocation method. Possible values are 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - ip_configuration_update.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference of the public IP resource.", - nullable=True, - ) - cls._build_args_public_ip_address_update(ip_configuration_update.public_ip_address) - ip_configuration_update.subnet = AAZObjectArg( - options=["subnet"], - help="The reference of the subnet resource.", - nullable=True, - ) - cls._build_args_subnet_update(ip_configuration_update.subnet) - - _schema.etag = cls._args_ip_configuration_update.etag - _schema.id = cls._args_ip_configuration_update.id - _schema.name = cls._args_ip_configuration_update.name - _schema.private_ip_address = cls._args_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_ip_configuration_update.private_ip_allocation_method - _schema.public_ip_address = cls._args_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_ip_configuration_update.subnet - - _args_network_interface_ip_configuration_update = None - - @classmethod - def _build_args_network_interface_ip_configuration_update(cls, _schema): - if cls._args_network_interface_ip_configuration_update is not None: - _schema.etag = cls._args_network_interface_ip_configuration_update.etag - _schema.id = cls._args_network_interface_ip_configuration_update.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_update.name - _schema.primary = cls._args_network_interface_ip_configuration_update.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_update.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_update.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_update.subnet - return - - cls._args_network_interface_ip_configuration_update = AAZObjectArg( - nullable=True, - ) - - network_interface_ip_configuration_update = cls._args_network_interface_ip_configuration_update - network_interface_ip_configuration_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_interface_ip_configuration_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - network_interface_ip_configuration_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - network_interface_ip_configuration_update.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - nullable=True, - ) - network_interface_ip_configuration_update.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - nullable=True, - ) - network_interface_ip_configuration_update.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - nullable=True, - ) - network_interface_ip_configuration_update.private_ip_address = AAZStrArg( - options=["private-ip-address"], - nullable=True, - ) - network_interface_ip_configuration_update.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - network_interface_ip_configuration_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - nullable=True, - ) - network_interface_ip_configuration_update.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address resource.", - nullable=True, - ) - cls._build_args_public_ip_address_update(network_interface_ip_configuration_update.public_ip_address) - network_interface_ip_configuration_update.subnet = AAZObjectArg( - options=["subnet"], - nullable=True, - ) - cls._build_args_subnet_update(network_interface_ip_configuration_update.subnet) - - load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.backend_ip_configurations = AAZListArg( - options=["backend-ip-configurations"], - help="Gets collection of references to IP addresses defined in network interfaces.", - nullable=True, - ) - _element.outbound_nat_rule = AAZObjectArg( - options=["outbound-nat-rule"], - help="Gets outbound rules that use this backend address pool.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.outbound_nat_rule) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - backend_ip_configurations = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools.Element.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_network_interface_ip_configuration_update(backend_ip_configurations.Element) - - load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.backend_ip_configuration = AAZObjectArg( - options=["backend-ip-configuration"], - help="A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backed IP.", - nullable=True, - ) - cls._build_args_network_interface_ip_configuration_update(_element.backend_ip_configuration) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - nullable=True, - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - nullable=True, - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'", - nullable=True, - enum={"Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - _schema.etag = cls._args_network_interface_ip_configuration_update.etag - _schema.id = cls._args_network_interface_ip_configuration_update.id - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_update.name - _schema.primary = cls._args_network_interface_ip_configuration_update.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_update.private_ip_address - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_update.private_ip_allocation_method - _schema.provisioning_state = cls._args_network_interface_ip_configuration_update.provisioning_state - _schema.public_ip_address = cls._args_network_interface_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_update.subnet - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg( - nullable=True, - ) - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - network_security_group_update.network_interfaces = AAZListArg( - options=["network-interfaces"], - help="A collection of references to network interfaces.", - nullable=True, - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - network_security_group_update.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - network_interfaces = cls._args_network_security_group_update.network_interfaces - network_interfaces.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.network_interfaces.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The DNS settings in network interface.", - nullable=True, - ) - _element.enable_ip_forwarding = AAZBoolArg( - options=["enable-ip-forwarding"], - help="Indicates whether IP forwarding is enabled on this network interface.", - nullable=True, - ) - _element.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="A list of IPConfigurations of the network interface.", - nullable=True, - ) - _element.mac_address = AAZStrArg( - options=["mac-address"], - help="The MAC address of the network interface.", - nullable=True, - ) - _element.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(_element.network_security_group) - _element.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary network interface on a virtual machine.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network interface resource.", - nullable=True, - ) - _element.virtual_machine = AAZObjectArg( - options=["virtual-machine"], - help="The reference of a virtual machine.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.virtual_machine) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_network_security_group_update.network_interfaces.Element.dns_settings - dns_settings.applied_dns_servers = AAZListArg( - options=["applied-dns-servers"], - help="If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs.", - nullable=True, - ) - dns_settings.dns_servers = AAZListArg( - options=["dns-servers"], - help="List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection.", - nullable=True, - ) - dns_settings.internal_dns_name_label = AAZStrArg( - options=["internal-dns-name-label"], - help="Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.", - nullable=True, - ) - dns_settings.internal_fqdn = AAZStrArg( - options=["internal-fqdn"], - help="Fully qualified DNS name supporting internal communications between VMs in the same virtual network.", - nullable=True, - ) - - applied_dns_servers = cls._args_network_security_group_update.network_interfaces.Element.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrArg( - nullable=True, - ) - - dns_servers = cls._args_network_security_group_update.network_interfaces.Element.dns_settings.dns_servers - dns_servers.Element = AAZStrArg( - nullable=True, - ) - - ip_configurations = cls._args_network_security_group_update.network_interfaces.Element.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_network_interface_ip_configuration_update(ip_configurations.Element) - - tags = cls._args_network_security_group_update.network_interfaces.Element.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}/securityRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - - subnets = cls._args_network_security_group_update.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.network_interfaces = cls._args_network_security_group_update.network_interfaces - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.subnets = cls._args_network_security_group_update.subnets - _schema.tags = cls._args_network_security_group_update.tags - - _args_public_ip_address_update = None - - @classmethod - def _build_args_public_ip_address_update(cls, _schema): - if cls._args_public_ip_address_update is not None: - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.ip_configuration = cls._args_public_ip_address_update.ip_configuration - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.tags = cls._args_public_ip_address_update.tags - return - - cls._args_public_ip_address_update = AAZObjectArg( - nullable=True, - ) - - public_ip_address_update = cls._args_public_ip_address_update - public_ip_address_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - public_ip_address_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_update.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - nullable=True, - ) - public_ip_address_update.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - nullable=True, - ) - public_ip_address_update.ip_address = AAZStrArg( - options=["ip-address"], - nullable=True, - ) - public_ip_address_update.ip_configuration = AAZObjectArg( - options=["ip-configuration"], - help="IPConfiguration", - nullable=True, - ) - cls._build_args_ip_configuration_update(public_ip_address_update.ip_configuration) - public_ip_address_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - public_ip_address_update.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - nullable=True, - ) - public_ip_address_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - dns_settings = cls._args_public_ip_address_update.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - nullable=True, - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - nullable=True, - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - nullable=True, - ) - - tags = cls._args_public_ip_address_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.ip_configuration = cls._args_public_ip_address_update.ip_configuration - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.tags = cls._args_public_ip_address_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_port_range = cls._args_security_rule_update.source_port_range - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_subnet_update = None - - @classmethod - def _build_args_subnet_update(cls, _schema): - if cls._args_subnet_update is not None: - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.ip_configurations = cls._args_subnet_update.ip_configurations - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.route_table = cls._args_subnet_update.route_table - return - - cls._args_subnet_update = AAZObjectArg( - nullable=True, - ) - - subnet_update = cls._args_subnet_update - subnet_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - subnet_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - subnet_update.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - nullable=True, - ) - subnet_update.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="Gets an array of references to the network interface IP configurations using subnet.", - nullable=True, - ) - subnet_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(subnet_update.network_security_group) - subnet_update.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - nullable=True, - ) - - ip_configurations = cls._args_subnet_update.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_ip_configuration_update(ip_configurations.Element) - - route_table = cls._args_subnet_update.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - nullable=True, - ) - route_table.subnets = AAZListArg( - options=["subnets"], - help="A collection of references to subnets.", - nullable=True, - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - routes = cls._args_subnet_update.route_table.routes - routes.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource Identifier.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - nullable=True, - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - nullable=True, - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - subnets = cls._args_subnet_update.route_table.subnets - subnets.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_subnet_update(subnets.Element) - - tags = cls._args_subnet_update.route_table.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.etag = cls._args_subnet_update.etag - _schema.ip_configurations = cls._args_subnet_update.ip_configurations - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.route_table = cls._args_subnet_update.route_table - - def _execute_operations(self): - self.pre_operations() - self.SubnetsGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.SubnetsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SubnetsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_subnet_read(cls._schema_on_200) - - return cls._schema_on_200 - - class SubnetsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_subnet_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("networkSecurityGroup", AAZObjectType) - properties.set_prop("routeTable", AAZObjectType) - - network_security_group = _builder.get(".properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("id", AAZStrType, ".network_security_group") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("id", AAZStrType, ".route_table") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_ip_configuration_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - @classmethod - def _build_schema_network_interface_ip_configuration_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("backendIPConfigurations", AAZListType, ".backend_ip_configurations") - cls._build_schema_sub_resource_update(properties.set_prop("outboundNatRule", AAZObjectType, ".outbound_nat_rule")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - backend_ip_configurations = _builder.get(".properties.loadBalancerBackendAddressPools[].properties.backendIPConfigurations") - if backend_ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_update(backend_ip_configurations.set_elements(AAZObjectType, ".")) - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - cls._build_schema_network_interface_ip_configuration_update(properties.set_prop("backendIPConfiguration", AAZObjectType, ".backend_ip_configuration")) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - cls._build_schema_sub_resource_update(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("networkInterfaces", AAZListType, ".network_interfaces") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - properties.set_prop("subnets", AAZListType, ".subnets") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - network_interfaces = _builder.get(".properties.networkInterfaces") - if network_interfaces is not None: - network_interfaces.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkInterfaces[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkInterfaces[].properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("enableIPForwarding", AAZBoolType, ".enable_ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("macAddress", AAZStrType, ".mac_address") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - cls._build_schema_sub_resource_update(properties.set_prop("virtualMachine", AAZObjectType, ".virtual_machine")) - - dns_settings = _builder.get(".properties.networkInterfaces[].properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("appliedDnsServers", AAZListType, ".applied_dns_servers") - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name_label") - dns_settings.set_prop("internalFqdn", AAZStrType, ".internal_fqdn") - - applied_dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.appliedDnsServers") - if applied_dns_servers is not None: - applied_dns_servers.set_elements(AAZStrType, ".") - - dns_servers = _builder.get(".properties.networkInterfaces[].properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.networkInterfaces[].properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_network_interface_ip_configuration_update(ip_configurations.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.networkInterfaces[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - cls._build_schema_ip_configuration_update(properties.set_prop("ipConfiguration", AAZObjectType, ".ip_configuration")) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("routeTable", AAZObjectType, ".route_table") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - cls._build_schema_ip_configuration_update(ip_configurations.set_elements(AAZObjectType, ".")) - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("routes", AAZListType, ".routes") - properties.set_prop("subnets", AAZListType, ".subnets") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - subnets = _builder.get(".properties.routeTable.properties.subnets") - if subnets is not None: - cls._build_schema_subnet_update(subnets.set_elements(AAZObjectType, ".")) - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_wait.py deleted file mode 100644 index 13885f5f03f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet/subnet/_wait.py +++ /dev/null @@ -1,736 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The subnet name.", - required=True, - id_part="child_name_1", - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SubnetsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class SubnetsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_subnet_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType() - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"required": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"required": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType() - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/__cmd_group.py deleted file mode 100644 index 06369b9d587..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet-gateway", -) -class __CMDGroup(AAZCommandGroup): - """Use an Azure Virtual Network Gateway to establish secure, cross-premises connectivity. - - To learn more about Azure Virtual Network Gateways, visit https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-cli. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_create.py deleted file mode 100644 index 8fe4cde3600..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_create.py +++ /dev/null @@ -1,593 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway create", -) -class Create(AAZCommand): - """Create a virtual network gateway. - - :example: Create a basic virtual network gateway for site-to-site connectivity. - az network vnet-gateway create -g MyResourceGroup -n MyVnetGateway --public-ip-address MyGatewayIp --vnet MyVnet --gateway-type Vpn --sku VpnGw1 --vpn-type RouteBased --no-wait - - :example: Create a virtual network gateway. - az network vnet-gateway create --gateway-type Vpn --location westus2 --name MyVnetGateway --no-wait --public-ip-addresses myVGPublicIPAddress --resource-group MyResourceGroup --sku Basic --vnet MyVnet --vpn-type PolicyBased - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.gateway_default_site = AAZStrArg( - options=["--gateway-default-site"], - help="Name or ID of a local network gateway representing a local network site with default routes.", - ) - _args_schema.gateway_type = AAZStrArg( - options=["--gateway-type"], - help="The gateway type.", - default="Vpn", - enum={"ExpressRoute": "ExpressRoute", "Vpn": "Vpn"}, - ) - _args_schema.ip_configurations = AAZListArg( - options=["--ip-configurations"], - help="IP configurations for virtual network gateway.", - ) - _args_schema.sku = AAZStrArg( - options=["--sku"], - help="VNet gateway SKU.", - default="Basic", - enum={"Basic": "Basic", "HighPerformance": "HighPerformance", "Standard": "Standard"}, - ) - _args_schema.vpn_type = AAZStrArg( - options=["--vpn-type"], - help="VPN routing type.", - default="RouteBased", - enum={"PolicyBased": "PolicyBased", "RouteBased": "RouteBased"}, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", - ) - - ip_configurations = cls._args_schema.ip_configurations - ip_configurations.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="Gets or sets the privateIPAddress of the IP Configuration", - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP address allocation method.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.public_ip_address = AAZStrArg( - options=["public-ip-address"], - help="The reference to the public IP resource.", - ) - _element.subnet = AAZStrArg( - options=["subnet"], - help="test", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "BGP Peering" - - _args_schema = cls._args_schema - _args_schema.asn = AAZIntArg( - options=["--asn"], - arg_group="BGP Peering", - help="Autonomous System Number to use for the BGP settings.", - ) - _args_schema.bgp_peering_address = AAZStrArg( - options=["--bgp-peering-address"], - arg_group="BGP Peering", - help="IP address to use for BGP peering.", - ) - _args_schema.peer_weight = AAZIntArg( - options=["--peer-weight"], - arg_group="BGP Peering", - help="Weight (0-100) added to routes learned through BGP peering.", - ) - _args_schema.enable_bgp = AAZBoolArg( - options=["--enable-bgp"], - arg_group="BGP Peering", - help="Enable BGP (Border Gateway Protocol).", - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.sku_tier = AAZStrArg( - options=["--sku-tier"], - arg_group="Properties", - help="Gateway SKU tier.", - enum={"Basic": "Basic", "HighPerformance": "HighPerformance", "Standard": "Standard"}, - ) - - # define Arg Group "Root Cert Authentication" - - _args_schema = cls._args_schema - _args_schema.vpn_client_root_certificates = AAZListArg( - options=["--vpn-client-root-certificates"], - arg_group="Root Cert Authentication", - help="VpnClientRootCertificate for virtual network gateway.", - ) - - vpn_client_root_certificates = cls._args_schema.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectArg() - - _element = cls._args_schema.vpn_client_root_certificates.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.public_cert_data = AAZStrArg( - options=["public-cert-data"], - help="The certificate public data.", - ) - - # define Arg Group "Sku" - - # define Arg Group "VPN Client" - - _args_schema = cls._args_schema - _args_schema.address_prefixes = AAZListArg( - options=["--address-prefixes"], - singular_options=["--address-prefix"], - arg_group="VPN Client", - help="Space-separated list of CIDR prefixes representing the address space for the P2S Vpnclient.", - ) - - address_prefixes = cls._args_schema.address_prefixes - address_prefixes.Element = AAZStrArg() - - # define Arg Group "VpnClientConfiguration" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("bgpSettings", AAZObjectType) - properties.set_prop("enableBgp", AAZBoolType, ".enable_bgp") - properties.set_prop("gatewayDefaultSite", AAZObjectType) - properties.set_prop("gatewayType", AAZStrType, ".gateway_type") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("sku", AAZObjectType) - properties.set_prop("vpnClientConfiguration", AAZObjectType) - properties.set_prop("vpnType", AAZStrType, ".vpn_type") - - bgp_settings = _builder.get(".properties.bgpSettings") - if bgp_settings is not None: - bgp_settings.set_prop("asn", AAZIntType, ".asn") - bgp_settings.set_prop("bgpPeeringAddress", AAZStrType, ".bgp_peering_address") - bgp_settings.set_prop("peerWeight", AAZIntType, ".peer_weight") - - gateway_default_site = _builder.get(".properties.gatewayDefaultSite") - if gateway_default_site is not None: - gateway_default_site.set_prop("id", AAZStrType, ".gateway_default_site") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAddress", AAZObjectType) - properties.set_prop("subnet", AAZObjectType) - - public_ip_address = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".public_ip_address") - - subnet = _builder.get(".properties.ipConfigurations[].properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - - sku = _builder.get(".properties.sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".sku") - sku.set_prop("tier", AAZStrType, ".sku_tier") - - vpn_client_configuration = _builder.get(".properties.vpnClientConfiguration") - if vpn_client_configuration is not None: - vpn_client_configuration.set_prop("vpnClientAddressPool", AAZObjectType) - vpn_client_configuration.set_prop("vpnClientRootCertificates", AAZListType, ".vpn_client_root_certificates") - - vpn_client_address_pool = _builder.get(".properties.vpnClientConfiguration.vpnClientAddressPool") - if vpn_client_address_pool is not None: - vpn_client_address_pool.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".properties.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - vpn_client_root_certificates = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates") - if vpn_client_root_certificates is not None: - vpn_client_root_certificates.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[].properties") - if properties is not None: - properties.set_prop("publicCertData", AAZStrType, ".public_cert_data") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.location = AAZStrType() - _schema_on_200_201.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200_201.tags = AAZDictType() - _schema_on_200_201.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - _CreateHelper._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = cls._schema_on_200_201.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = cls._schema_on_200_201.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.ip_configurations.Element.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _CreateHelper._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(properties.subnet) - - sku = cls._schema_on_200_201.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = cls._schema_on_200_201.properties.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_revoked_certificates = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - ) - - tags = cls._schema_on_200_201.tags - tags.Element = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_delete.py deleted file mode 100644 index 574dda2445f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_delete.py +++ /dev/null @@ -1,164 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway delete", -) -class Delete(AAZCommand): - """Delete a virtual network gateway. - - In order to delete a Virtual Network Gateway, you must first delete ALL Connection objects in Azure that are connected to the Gateway. After deleting the Gateway, proceed to delete other resources now not in use. For more information, follow the order of instructions on this page: https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-delete-vnet-gateway-portal - - :example: Delete a virtual network gateway. - az network vnet-gateway delete -g MyResourceGroup -n MyVnetGateway - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class VirtualNetworkGatewaysDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_list.py deleted file mode 100644 index 661d5d4d341..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_list.py +++ /dev/null @@ -1,322 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway list", -) -class List(AAZCommand): - """List virtual network gateways. - - :example: List virtual network gateways in a resource group. - az network vnet-gateway list -g MyResourceGroup - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class VirtualNetworkGatewaysList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - _ListHelper._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = cls._schema_on_200.value.Element.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = cls._schema_on_200.value.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.ip_configurations.Element.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _ListHelper._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(properties.subnet) - - sku = cls._schema_on_200.value.Element.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = cls._schema_on_200.value.Element.properties.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_revoked_certificates = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - ) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_show.py deleted file mode 100644 index 3bf5702cbe2..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_show.py +++ /dev/null @@ -1,323 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway show", -) -class Show(AAZCommand): - """Get the details of a virtual network gateway. - - :example: Get the details of a virtual network gateway. - az network vnet-gateway show -g MyResourceGroup -n MyVnetGateway - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - _ShowHelper._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = cls._schema_on_200.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = cls._schema_on_200.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.ip_configurations.Element.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _ShowHelper._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(properties.subnet) - - sku = cls._schema_on_200.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = cls._schema_on_200.properties.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_revoked_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_update.py deleted file mode 100644 index ec32706cb5e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_update.py +++ /dev/null @@ -1,775 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway update", -) -class Update(AAZCommand): - """Update a virtual network gateway. - - :example: Change the SKU of a virtual network gateway. - az network vnet-gateway update -g MyResourceGroup -n MyVnetGateway --sku VpnGw2 - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - _args_schema.gateway_default_site = AAZStrArg( - options=["--gateway-default-site"], - help="Name or ID of a local network gateway representing a local network site with default routes.", - nullable=True, - ) - _args_schema.gateway_type = AAZStrArg( - options=["--gateway-type"], - help="The gateway type.", - nullable=True, - enum={"ExpressRoute": "ExpressRoute", "Vpn": "Vpn"}, - ) - _args_schema.sku = AAZStrArg( - options=["--sku"], - help="VNet gateway SKU.", - nullable=True, - enum={"Basic": "Basic", "HighPerformance": "HighPerformance", "Standard": "Standard"}, - ) - _args_schema.vpn_type = AAZStrArg( - options=["--vpn-type"], - help="VPN routing type.", - nullable=True, - enum={"PolicyBased": "PolicyBased", "RouteBased": "RouteBased"}, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "BGP Peering" - - _args_schema = cls._args_schema - _args_schema.asn = AAZIntArg( - options=["--asn"], - arg_group="BGP Peering", - help="Autonomous System Number to use for the BGP settings.", - nullable=True, - ) - _args_schema.bgp_peering_address = AAZStrArg( - options=["--bgp-peering-address"], - arg_group="BGP Peering", - help="IP address to use for BGP peering.", - nullable=True, - ) - _args_schema.peer_weight = AAZIntArg( - options=["--peer-weight"], - arg_group="BGP Peering", - help="Weight (0-100) added to routes learned through BGP peering.", - nullable=True, - ) - _args_schema.enable_bgp = AAZBoolArg( - options=["--enable-bgp"], - arg_group="BGP Peering", - help="Enable BGP (Border Gateway Protocol).", - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.ip_configurations = AAZListArg( - options=["--ip-configurations"], - arg_group="Properties", - help="IP configurations for virtual network gateway.", - nullable=True, - ) - _args_schema.sku_tier = AAZStrArg( - options=["--sku-tier"], - arg_group="Properties", - help="Gateway SKU tier.", - nullable=True, - enum={"Basic": "Basic", "HighPerformance": "HighPerformance", "Standard": "Standard"}, - ) - - ip_configurations = cls._args_schema.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="Gets or sets the privateIPAddress of the IP Configuration", - nullable=True, - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP address allocation method.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference to the public IP resource.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.public_ip_address) - _element.subnet = AAZStrArg( - options=["subnet"], - help="test", - nullable=True, - ) - - # define Arg Group "Root Cert Authentication" - - _args_schema = cls._args_schema - _args_schema.vpn_client_root_certificates = AAZListArg( - options=["--vpn-client-root-certificates"], - arg_group="Root Cert Authentication", - help="VpnClientRootCertificate for virtual network gateway.", - nullable=True, - ) - - vpn_client_root_certificates = cls._args_schema.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.vpn_client_root_certificates.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.public_cert_data = AAZStrArg( - options=["public-cert-data"], - help="The certificate public data.", - nullable=True, - ) - - # define Arg Group "Sku" - - # define Arg Group "VPN Client" - - _args_schema = cls._args_schema - _args_schema.address_prefixes = AAZListArg( - options=["--address-prefixes"], - singular_options=["--address-prefix"], - arg_group="VPN Client", - help="Space-separated list of CIDR prefixes representing the address space for the P2S Vpnclient.", - nullable=True, - ) - - address_prefixes = cls._args_schema.address_prefixes - address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "VpnClientConfiguration" - return cls._args_schema - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("bgpSettings", AAZObjectType) - properties.set_prop("enableBgp", AAZBoolType, ".enable_bgp") - properties.set_prop("gatewayDefaultSite", AAZObjectType) - properties.set_prop("gatewayType", AAZStrType, ".gateway_type") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("sku", AAZObjectType) - properties.set_prop("vpnClientConfiguration", AAZObjectType) - properties.set_prop("vpnType", AAZStrType, ".vpn_type") - - bgp_settings = _builder.get(".properties.bgpSettings") - if bgp_settings is not None: - bgp_settings.set_prop("asn", AAZIntType, ".asn") - bgp_settings.set_prop("bgpPeeringAddress", AAZStrType, ".bgp_peering_address") - bgp_settings.set_prop("peerWeight", AAZIntType, ".peer_weight") - - gateway_default_site = _builder.get(".properties.gatewayDefaultSite") - if gateway_default_site is not None: - gateway_default_site.set_prop("id", AAZStrType, ".gateway_default_site") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - _UpdateHelper._build_schema_sub_resource_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - properties.set_prop("subnet", AAZObjectType) - - subnet = _builder.get(".properties.ipConfigurations[].properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - - sku = _builder.get(".properties.sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".sku") - sku.set_prop("tier", AAZStrType, ".sku_tier") - - vpn_client_configuration = _builder.get(".properties.vpnClientConfiguration") - if vpn_client_configuration is not None: - vpn_client_configuration.set_prop("vpnClientAddressPool", AAZObjectType) - vpn_client_configuration.set_prop("vpnClientRootCertificates", AAZListType, ".vpn_client_root_certificates") - - vpn_client_address_pool = _builder.get(".properties.vpnClientConfiguration.vpnClientAddressPool") - if vpn_client_address_pool is not None: - vpn_client_address_pool.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".properties.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - vpn_client_root_certificates = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates") - if vpn_client_root_certificates is not None: - vpn_client_root_certificates.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[].properties") - if properties is not None: - properties.set_prop("publicCertData", AAZStrType, ".public_cert_data") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_wait.py deleted file mode 100644 index 23da921b2e9..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/_wait.py +++ /dev/null @@ -1,319 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - _WaitHelper._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = cls._schema_on_200.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = cls._schema_on_200.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.ip_configurations.Element.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _WaitHelper._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(properties.subnet) - - sku = cls._schema_on_200.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = cls._schema_on_200.properties.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_revoked_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/revoked_cert/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/revoked_cert/__cmd_group.py deleted file mode 100644 index ca7e7a8061f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/revoked_cert/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet-gateway revoked-cert", -) -class __CMDGroup(AAZCommandGroup): - """Manage revoked certificates in a virtual network gateway. Prevent machines using this certificate from accessing Azure through this gateway. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/revoked_cert/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/revoked_cert/__init__.py deleted file mode 100644 index cf0f7e303bd..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/revoked_cert/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/revoked_cert/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/revoked_cert/_create.py deleted file mode 100644 index 6ed48871354..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/revoked_cert/_create.py +++ /dev/null @@ -1,527 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway revoked-cert create", -) -class Create(AAZCommand): - """Revoke a certificate. - - :example: Revoke a certificate. - az network vnet-gateway revoked-cert create -g MyResourceGroup -n MyRootCertificate --gateway-name MyVnetGateway --thumbprint abc123 - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2015-06-15", "properties.vpnClientConfiguration.vpnClientRevokedCertificates[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Root certificate name.", - required=True, - ) - _args_schema.thumbprint = AAZStrArg( - options=["--thumbprint"], - help="Certificate thumbprint.", - ) - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRevokedCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRevokedCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("thumbprint", AAZStrType, ".thumbprint") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/revoked_cert/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/revoked_cert/_delete.py deleted file mode 100644 index 1bafbc6e658..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/revoked_cert/_delete.py +++ /dev/null @@ -1,506 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway revoked-cert delete", -) -class Delete(AAZCommand): - """Delete a revoked certificate. - - :example: Delete a revoked certificate. - az network vnet-gateway revoked-cert delete -g MyResourceGroup -n MyRootCertificate --gateway-name MyVnetGateway - - :example: Delete a revoked certificate. - az network vnet-gateway revoked-cert delete --gateway-name MyVnetGateway --name MyRootCertificate --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2015-06-15", "properties.vpnClientConfiguration.vpnClientRevokedCertificates[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Root certificate name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRevokedCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRevokedCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/revoked_cert/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/revoked_cert/_wait.py deleted file mode 100644 index 5bee6958d49..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/revoked_cert/_wait.py +++ /dev/null @@ -1,344 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway revoked-cert wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2015-06-15", "properties.vpnClientConfiguration.vpnClientRevokedCertificates[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/root_cert/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/root_cert/__cmd_group.py deleted file mode 100644 index c69c7128a05..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/root_cert/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet-gateway root-cert", -) -class __CMDGroup(AAZCommandGroup): - """Manage root certificates of a virtual network gateway. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/root_cert/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/root_cert/__init__.py deleted file mode 100644 index cf0f7e303bd..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/root_cert/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/root_cert/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/root_cert/_create.py deleted file mode 100644 index 451daaad022..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/root_cert/_create.py +++ /dev/null @@ -1,524 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway root-cert create", -) -class Create(AAZCommand): - """Upload a root certificate. - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2015-06-15", "properties.vpnClientConfiguration.vpnClientRootCertificates[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Root certificate name.", - required=True, - ) - _args_schema.root_cert_data = AAZStrArg( - options=["--root-cert-data"], - help="Base64 contents of the root certificate file or file path.", - ) - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRootCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRootCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("publicCertData", AAZStrType, ".root_cert_data") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/root_cert/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/root_cert/_delete.py deleted file mode 100644 index 933fd91d8c0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/root_cert/_delete.py +++ /dev/null @@ -1,506 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway root-cert delete", -) -class Delete(AAZCommand): - """Delete a root certificate. - - :example: Remove a certificate from the list of Root Certificates whose children are allowed to access this Gateway. - az network vnet-gateway root-cert delete -g MyResourceGroup -n MyRootCertificate --gateway-name MyVnetGateway - - :example: Delete a root certificate. - az network vnet-gateway root-cert delete --gateway-name MyVnetGateway --name MyRootCertificate --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2015-06-15", "properties.vpnClientConfiguration.vpnClientRootCertificates[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Root certificate name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRootCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRootCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/root_cert/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/root_cert/_wait.py deleted file mode 100644 index 7b516963871..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/root_cert/_wait.py +++ /dev/null @@ -1,344 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway root-cert wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2015-06-15", "properties.vpnClientConfiguration.vpnClientRootCertificates[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/vpn_client/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/vpn_client/__cmd_group.py deleted file mode 100644 index 91bef18b63a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/vpn_client/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet-gateway vpn-client", -) -class __CMDGroup(AAZCommandGroup): - """Download a VPN client configuration required to connect to Azure via point-to-site. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/vpn_client/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/vpn_client/__init__.py deleted file mode 100644 index 422378d85da..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/vpn_client/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._generate import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/vpn_client/_generate.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/vpn_client/_generate.py deleted file mode 100644 index 7d3fe82288e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vnet_gateway/vpn_client/_generate.py +++ /dev/null @@ -1,206 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway vpn-client generate", -) -class Generate(AAZCommand): - """Generate VPN client configuration. - - :example: Create the VPN client configuration for AMD64 architecture. - az network vnet-gateway vpn-client generate -g MyResourceGroup -n MyVnetGateway --processor-architecture Amd64 - - :example: Generate VPN client configuration. - az network vnet-gateway vpn-client generate --name MyVnetGateway --processor-architecture Amd64 --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/generatevpnclientpackage", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.processor_architecture = AAZStrArg( - options=["--processor-architecture"], - arg_group="Parameters", - help="VPN client Processor Architecture. Possible values are: 'AMD64' and 'X86'.", - enum={"Amd64": "Amd64", "X86": "X86"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysGeneratevpnclientpackage(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGeneratevpnclientpackage(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("ProcessorArchitecture", AAZStrType, ".processor_architecture") - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZStrType() - - return cls._schema_on_200 - - -class _GenerateHelper: - """Helper class for Generate""" - - -__all__ = ["Generate"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/__cmd_group.py deleted file mode 100644 index 7668b41df2f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vpn-connection", -) -class __CMDGroup(AAZCommandGroup): - """Manage VPN connections. - - For more information on site-to-site connections, visit https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-cli. For more information on Vnet-to-Vnet connections, visit https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-vnet-vnet-cli. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/__init__.py deleted file mode 100644 index f32b66e3eeb..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._delete import * -from ._list import * -from ._show import * -from ._update import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/_delete.py deleted file mode 100644 index e1021d230b5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection delete", -) -class Delete(AAZCommand): - """Delete a VPN connection. - - :example: Delete a VPN connection. - az network vpn-connection delete -g MyResourceGroup -n MyConnection - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Connection name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewayConnectionsDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class VirtualNetworkGatewayConnectionsDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/_list.py deleted file mode 100644 index 5f8d8b43978..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/_list.py +++ /dev/null @@ -1,476 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection list", -) -class List(AAZCommand): - """List all VPN connections. - - :example: List all VPN connections in a resource group. - az network vpn-connection list -g MyResourceGroup - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class VirtualNetworkGatewayConnectionsList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - ) - _ListHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - _ListHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - local_network_gateway2 = cls._schema_on_200.value.Element.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - _ListHelper._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - _ListHelper._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = cls._schema_on_200.value.Element.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/_show.py deleted file mode 100644 index 8edc37e0351..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/_show.py +++ /dev/null @@ -1,477 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection show", -) -class Show(AAZCommand): - """Get the details of a VPN connection. - - :example: View the details of a VPN connection. - az network vpn-connection show -g MyResourceGroup -n MyConnection - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Connection name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewayConnectionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - ) - _ShowHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - _ShowHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - local_network_gateway2 = cls._schema_on_200.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - _ShowHelper._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - _ShowHelper._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = cls._schema_on_200.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/_update.py deleted file mode 100644 index 6bb847e41c8..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/_update.py +++ /dev/null @@ -1,1155 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection update", -) -class Update(AAZCommand): - """Update a VPN connection. - - :example: Add BGP to an existing connection. - az network vpn-connection update -g MyResourceGroup -n MyConnection --enable-bgp True - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Connection name.", - required=True, - id_part="name", - ) - _args_schema.enable_bgp = AAZBoolArg( - options=["--enable-bgp"], - help="Enable BGP (Border Gateway Protocol).", - nullable=True, - ) - _args_schema.routing_weight = AAZIntArg( - options=["--routing-weight"], - help="Connection routing weight.", - nullable=True, - ) - _args_schema.shared_key = AAZStrArg( - options=["--shared-key"], - help="Shared IPSec key.", - nullable=True, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - return cls._args_schema - - _args_address_space_update = None - - @classmethod - def _build_args_address_space_update(cls, _schema): - if cls._args_address_space_update is not None: - _schema.address_prefixes = cls._args_address_space_update.address_prefixes - return - - cls._args_address_space_update = AAZObjectArg( - nullable=True, - ) - - address_space_update = cls._args_address_space_update - address_space_update.address_prefixes = AAZListArg( - options=["address-prefixes"], - help="A list of address blocks reserved for this virtual network in CIDR notation.", - nullable=True, - ) - - address_prefixes = cls._args_address_space_update.address_prefixes - address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - _schema.address_prefixes = cls._args_address_space_update.address_prefixes - - _args_bgp_settings_update = None - - @classmethod - def _build_args_bgp_settings_update(cls, _schema): - if cls._args_bgp_settings_update is not None: - _schema.asn = cls._args_bgp_settings_update.asn - _schema.bgp_peering_address = cls._args_bgp_settings_update.bgp_peering_address - _schema.peer_weight = cls._args_bgp_settings_update.peer_weight - return - - cls._args_bgp_settings_update = AAZObjectArg( - nullable=True, - ) - - bgp_settings_update = cls._args_bgp_settings_update - bgp_settings_update.asn = AAZIntArg( - options=["asn"], - help="The BGP speaker's ASN.", - nullable=True, - ) - bgp_settings_update.bgp_peering_address = AAZStrArg( - options=["bgp-peering-address"], - help="The BGP peering address and BGP identifier of this BGP speaker.", - nullable=True, - ) - bgp_settings_update.peer_weight = AAZIntArg( - options=["peer-weight"], - help="The weight added to routes learned from this BGP speaker.", - nullable=True, - ) - - _schema.asn = cls._args_bgp_settings_update.asn - _schema.bgp_peering_address = cls._args_bgp_settings_update.bgp_peering_address - _schema.peer_weight = cls._args_bgp_settings_update.peer_weight - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_virtual_network_gateway_update = None - - @classmethod - def _build_args_virtual_network_gateway_update(cls, _schema): - if cls._args_virtual_network_gateway_update is not None: - _schema.bgp_settings = cls._args_virtual_network_gateway_update.bgp_settings - _schema.enable_bgp = cls._args_virtual_network_gateway_update.enable_bgp - _schema.etag = cls._args_virtual_network_gateway_update.etag - _schema.gateway_default_site = cls._args_virtual_network_gateway_update.gateway_default_site - _schema.gateway_type = cls._args_virtual_network_gateway_update.gateway_type - _schema.ip_configurations = cls._args_virtual_network_gateway_update.ip_configurations - _schema.location = cls._args_virtual_network_gateway_update.location - _schema.provisioning_state = cls._args_virtual_network_gateway_update.provisioning_state - _schema.resource_guid = cls._args_virtual_network_gateway_update.resource_guid - _schema.sku = cls._args_virtual_network_gateway_update.sku - _schema.tags = cls._args_virtual_network_gateway_update.tags - _schema.vpn_client_configuration = cls._args_virtual_network_gateway_update.vpn_client_configuration - _schema.vpn_type = cls._args_virtual_network_gateway_update.vpn_type - return - - cls._args_virtual_network_gateway_update = AAZObjectArg( - nullable=True, - ) - - virtual_network_gateway_update = cls._args_virtual_network_gateway_update - virtual_network_gateway_update.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - virtual_network_gateway_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - virtual_network_gateway_update.bgp_settings = AAZObjectArg( - options=["bgp-settings"], - help="Virtual network gateway's BGP speaker settings.", - nullable=True, - ) - cls._build_args_bgp_settings_update(virtual_network_gateway_update.bgp_settings) - virtual_network_gateway_update.enable_bgp = AAZBoolArg( - options=["enable-bgp"], - help="Whether BGP is enabled for this virtual network gateway or not.", - nullable=True, - ) - virtual_network_gateway_update.gateway_default_site = AAZObjectArg( - options=["gateway-default-site"], - help="The reference to the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting.", - nullable=True, - ) - cls._build_args_sub_resource_update(virtual_network_gateway_update.gateway_default_site) - virtual_network_gateway_update.gateway_type = AAZStrArg( - options=["gateway-type"], - help="The type of this virtual network gateway.", - nullable=True, - enum={"ExpressRoute": "ExpressRoute", "Vpn": "Vpn"}, - ) - virtual_network_gateway_update.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="IP configurations for virtual network gateway.", - nullable=True, - ) - virtual_network_gateway_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the VirtualNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - virtual_network_gateway_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the VirtualNetworkGateway resource.", - nullable=True, - ) - virtual_network_gateway_update.sku = AAZObjectArg( - options=["sku"], - help="The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway.", - nullable=True, - ) - virtual_network_gateway_update.vpn_client_configuration = AAZObjectArg( - options=["vpn-client-configuration"], - help="The reference to the VpnClientConfiguration resource which represents the P2S VpnClient configurations.", - nullable=True, - ) - virtual_network_gateway_update.vpn_type = AAZStrArg( - options=["vpn-type"], - help="The type of this virtual network gateway.", - nullable=True, - enum={"PolicyBased": "PolicyBased", "RouteBased": "RouteBased"}, - ) - virtual_network_gateway_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - ip_configurations = cls._args_virtual_network_gateway_update.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_virtual_network_gateway_update.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="Gets or sets the privateIPAddress of the IP Configuration", - nullable=True, - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP address allocation method.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference to the public IP resource.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.public_ip_address) - _element.subnet = AAZObjectArg( - options=["subnet"], - help="The reference to the subnet resource.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.subnet) - - sku = cls._args_virtual_network_gateway_update.sku - sku.capacity = AAZIntArg( - options=["capacity"], - help="The capacity.", - nullable=True, - ) - sku.name = AAZStrArg( - options=["name"], - help="Gateway SKU name.", - nullable=True, - enum={"Basic": "Basic", "HighPerformance": "HighPerformance", "Standard": "Standard"}, - ) - sku.tier = AAZStrArg( - options=["tier"], - help="Gateway SKU tier.", - nullable=True, - enum={"Basic": "Basic", "HighPerformance": "HighPerformance", "Standard": "Standard"}, - ) - - vpn_client_configuration = cls._args_virtual_network_gateway_update.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectArg( - options=["vpn-client-address-pool"], - help="The reference to the address space resource which represents Address space for P2S VpnClient.", - nullable=True, - ) - cls._build_args_address_space_update(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListArg( - options=["vpn-client-revoked-certificates"], - help="VpnClientRevokedCertificate for Virtual network gateway.", - nullable=True, - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListArg( - options=["vpn-client-root-certificates"], - help="VpnClientRootCertificate for virtual network gateway.", - nullable=True, - ) - - vpn_client_revoked_certificates = cls._args_virtual_network_gateway_update.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_virtual_network_gateway_update.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the VPN client revoked certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.thumbprint = AAZStrArg( - options=["thumbprint"], - help="The revoked VPN client certificate thumbprint.", - nullable=True, - ) - - vpn_client_root_certificates = cls._args_virtual_network_gateway_update.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_virtual_network_gateway_update.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.public_cert_data = AAZStrArg( - options=["public-cert-data"], - help="The certificate public data.", - nullable=True, - ) - - tags = cls._args_virtual_network_gateway_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.bgp_settings = cls._args_virtual_network_gateway_update.bgp_settings - _schema.enable_bgp = cls._args_virtual_network_gateway_update.enable_bgp - _schema.etag = cls._args_virtual_network_gateway_update.etag - _schema.gateway_default_site = cls._args_virtual_network_gateway_update.gateway_default_site - _schema.gateway_type = cls._args_virtual_network_gateway_update.gateway_type - _schema.ip_configurations = cls._args_virtual_network_gateway_update.ip_configurations - _schema.location = cls._args_virtual_network_gateway_update.location - _schema.provisioning_state = cls._args_virtual_network_gateway_update.provisioning_state - _schema.resource_guid = cls._args_virtual_network_gateway_update.resource_guid - _schema.sku = cls._args_virtual_network_gateway_update.sku - _schema.tags = cls._args_virtual_network_gateway_update.tags - _schema.vpn_client_configuration = cls._args_virtual_network_gateway_update.vpn_client_configuration - _schema.vpn_type = cls._args_virtual_network_gateway_update.vpn_type - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.VirtualNetworkGatewayConnectionsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewayConnectionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_gateway_connection_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewayConnectionsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_gateway_connection_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("enableBgp", AAZBoolType, ".enable_bgp") - properties.set_prop("routingWeight", AAZIntType, ".routing_weight") - properties.set_prop("sharedKey", AAZStrType, ".shared_key") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_address_space_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_bgp_settings_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("asn", AAZIntType, ".asn") - _builder.set_prop("bgpPeeringAddress", AAZStrType, ".bgp_peering_address") - _builder.set_prop("peerWeight", AAZIntType, ".peer_weight") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_virtual_network_gateway_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - cls._build_schema_bgp_settings_update(properties.set_prop("bgpSettings", AAZObjectType, ".bgp_settings")) - properties.set_prop("enableBgp", AAZBoolType, ".enable_bgp") - cls._build_schema_sub_resource_update(properties.set_prop("gatewayDefaultSite", AAZObjectType, ".gateway_default_site")) - properties.set_prop("gatewayType", AAZStrType, ".gateway_type") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("sku", AAZObjectType, ".sku") - properties.set_prop("vpnClientConfiguration", AAZObjectType, ".vpn_client_configuration") - properties.set_prop("vpnType", AAZStrType, ".vpn_type") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_sub_resource_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_sub_resource_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - sku = _builder.get(".properties.sku") - if sku is not None: - sku.set_prop("capacity", AAZIntType, ".capacity") - sku.set_prop("name", AAZStrType, ".name") - sku.set_prop("tier", AAZStrType, ".tier") - - vpn_client_configuration = _builder.get(".properties.vpnClientConfiguration") - if vpn_client_configuration is not None: - cls._build_schema_address_space_update(vpn_client_configuration.set_prop("vpnClientAddressPool", AAZObjectType, ".vpn_client_address_pool")) - vpn_client_configuration.set_prop("vpnClientRevokedCertificates", AAZListType, ".vpn_client_revoked_certificates") - vpn_client_configuration.set_prop("vpnClientRootCertificates", AAZListType, ".vpn_client_root_certificates") - - vpn_client_revoked_certificates = _builder.get(".properties.vpnClientConfiguration.vpnClientRevokedCertificates") - if vpn_client_revoked_certificates is not None: - vpn_client_revoked_certificates.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.vpnClientConfiguration.vpnClientRevokedCertificates[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.vpnClientConfiguration.vpnClientRevokedCertificates[].properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("thumbprint", AAZStrType, ".thumbprint") - - vpn_client_root_certificates = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates") - if vpn_client_root_certificates is not None: - vpn_client_root_certificates.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[].properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicCertData", AAZStrType, ".public_cert_data") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_connection_read = None - - @classmethod - def _build_schema_virtual_network_gateway_connection_read(cls, _schema): - if cls._schema_virtual_network_gateway_connection_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - return - - cls._schema_virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read = AAZObjectType() - - virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read - virtual_network_gateway_connection_read.etag = AAZStrType() - virtual_network_gateway_connection_read.id = AAZStrType() - virtual_network_gateway_connection_read.location = AAZStrType() - virtual_network_gateway_connection_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_connection_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_gateway_connection_read.tags = AAZDictType() - virtual_network_gateway_connection_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - cls._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - local_network_gateway2 = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - cls._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tags = _schema_virtual_network_gateway_connection_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/_wait.py deleted file mode 100644 index 2922e332ad4..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/_wait.py +++ /dev/null @@ -1,473 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Connection name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewayConnectionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - ) - _WaitHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - _WaitHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - local_network_gateway2 = cls._schema_on_200.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - _WaitHelper._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - _WaitHelper._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = cls._schema_on_200.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/shared_key/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/shared_key/__cmd_group.py deleted file mode 100644 index 578d7fccf42..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/shared_key/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vpn-connection shared-key", -) -class __CMDGroup(AAZCommandGroup): - """Manage VPN shared keys. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/shared_key/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/shared_key/__init__.py deleted file mode 100644 index c7524bb868c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/shared_key/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._reset import * -from ._show import * -from ._update import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/shared_key/_reset.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/shared_key/_reset.py deleted file mode 100644 index 4c827c84186..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/shared_key/_reset.py +++ /dev/null @@ -1,205 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection shared-key reset", -) -class Reset(AAZCommand): - """Reset a VPN connection shared key. - - :example: Reset the shared key on a connection. - az network vpn-connection shared-key reset -g MyResourceGroup --connection-name MyConnection --key-length 128 - - :example: Reset a VPN connection shared key. - az network vpn-connection shared-key reset --connection-name MyConnection --key-length 128 --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}/sharedkey/reset", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.connection_name = AAZStrArg( - options=["--connection-name"], - help="Connection name.", - required=True, - id_part="name", - ) - _args_schema.key_length = AAZIntArg( - options=["--key-length"], - help="The virtual network connection reset shared key length, should between 1 and 128.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewayConnectionsResetSharedKey(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewayConnectionsResetSharedKey(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("keyLength", AAZIntType, ".key_length") - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.key_length = AAZIntType( - serialized_name="keyLength", - ) - - return cls._schema_on_200 - - -class _ResetHelper: - """Helper class for Reset""" - - -__all__ = ["Reset"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/shared_key/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/shared_key/_show.py deleted file mode 100644 index b2a88e9381b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/shared_key/_show.py +++ /dev/null @@ -1,168 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection shared-key show", -) -class Show(AAZCommand): - """Retrieve a VPN connection shared key. - - :example: View the shared key of a connection. - az network vpn-connection shared-key show -g MyResourceGroup --connection-name MyConnection - - :example: Retrieve a VPN connection shared key. - az network vpn-connection shared-key show --connection-name MyConnection --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}/sharedkey", "2015-06-15"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.connection_name = AAZStrArg( - options=["--connection-name"], - help="Connection name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGetSharedKey(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewayConnectionsGetSharedKey(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.value = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/shared_key/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/shared_key/_update.py deleted file mode 100644 index aeff52fd233..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2017_03_09_profile/network/vpn_connection/shared_key/_update.py +++ /dev/null @@ -1,325 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection shared-key update", -) -class Update(AAZCommand): - """Update a VPN connection shared key. - - :example: Change the shared key for the connection to "Abc123". - az network vpn-connection shared-key update -g MyResourceGroup --connection-name MyConnection --value Abc123 - - :example: Update a VPN connection shared key. - az network vpn-connection shared-key update --connection-name MyConnection --resource-group MyResourceGroup --subscription MySubscription --value Abc123 - """ - - _aaz_info = { - "version": "2015-06-15", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}/sharedkey", "2015-06-15"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.connection_name = AAZStrArg( - options=["--connection-name"], - help="Connection name.", - required=True, - id_part="name", - ) - _args_schema.value = AAZStrArg( - options=["--value"], - help="The virtual network connection shared key value.", - nullable=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGetSharedKey(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.VirtualNetworkGatewayConnectionsSetSharedKey(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewayConnectionsGetSharedKey(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.value = AAZStrType() - - return cls._schema_on_200 - - class VirtualNetworkGatewayConnectionsSetSharedKey(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2015-06-15", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.value = AAZStrType() - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("value", AAZStrType, ".value") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/__init__.py deleted file mode 100644 index f6acc11aa4e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 - diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/__cmd_group.py deleted file mode 100644 index 5093d2928ba..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/__init__.py deleted file mode 100644 index 1ec185c184e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._list_usages import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/_list_usages.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/_list_usages.py deleted file mode 100644 index efef9908071..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/_list_usages.py +++ /dev/null @@ -1,185 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network list-usages", -) -class ListUsages(AAZCommand): - """List the number of network resources in a region that are used against a subscription quota. - - :example: List the provisioned network resources in East US region within a subscription. - az network list-usages --location eastus -o table - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/locations/{}/usages", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.UsagesList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class UsagesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "location", self.ctx.args.location, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.current_value = AAZIntType( - serialized_name="currentValue", - flags={"required": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.limit = AAZIntType( - flags={"required": True}, - ) - _element.name = AAZObjectType( - flags={"required": True}, - ) - _element.unit = AAZStrType( - flags={"required": True}, - ) - - name = cls._schema_on_200.value.Element.name - name.localized_value = AAZStrType( - serialized_name="localizedValue", - ) - name.value = AAZStrType() - - return cls._schema_on_200 - - -class _ListUsagesHelper: - """Helper class for ListUsages""" - - -__all__ = ["ListUsages"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/__cmd_group.py deleted file mode 100644 index 154e082d718..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb", -) -class __CMDGroup(AAZCommandGroup): - """Manage and configure load balancers. - - To learn more about Azure Load Balancer visit https://learn.microsoft.com/en-us/azure/load-balancer/quickstart-load-balancer-standard-public-cli. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/__init__.py deleted file mode 100644 index 8fb933aeeb1..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._list_nic import * -from ._show import * -from ._update import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_create.py deleted file mode 100644 index efc6aecc78c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_create.py +++ /dev/null @@ -1,1954 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Create(AAZCommand): - """Create a load balancer. - - :example: Create a basic load balancer. - az network lb create -g MyResourceGroup -n MyLb --sku Basic - - :example: Create a basic load balancer on a specific virtual network and subnet If a virtual network with the same name is found in the same resource group, the load balancer will utilize this virtual network. If one is not found a new one will be created. - az network lb create -g MyResourceGroup -n MyLb --sku Basic --vnet-name MyVnet --subnet MySubnet - - :example: Create a basic load balancer on a subnet of a pre-existing virtual network. The subnet can be in arbitary resource group or subscription by providing the ID of the subnet. - az network lb create -g MyResourceGroup -n MyLb --sku Basic --subnet {subnetID} - - :example: Create a basic zone flavored internal load balancer, through provisioning a zonal public ip. - az network lb create -g MyResourceGroup -n MyLb --sku Basic --public-ip-zone 2 - - :example: Create a standard zone flavored public-facing load balancer, through provisioning a zonal frontend ip configuration and Vnet. - az etwork lb create -g MyResourceGroup -n MyLb --sku Standard --frontend-ip-zone 1 --vnet-name MyVnet --subnet MySubnet - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - arg_group="Parameters", - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.sku = AAZObjectArg( - options=["--sku"], - arg_group="Parameters", - help="The load balancer SKU.", - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Parameters", - help="Resource tags.", - ) - - sku = cls._args_schema.sku - sku.name = AAZStrArg( - options=["name"], - help="Name of a load balancer SKU.", - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_address_pools = AAZListArg( - options=["--backend-address-pools"], - arg_group="Properties", - help="Collection of backend address pools used by a load balancer.", - ) - _args_schema.inbound_nat_pools = AAZListArg( - options=["--inbound-nat-pools"], - arg_group="Properties", - help="Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound NAT rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules.", - ) - _args_schema.inbound_nat_rules = AAZListArg( - options=["--inbound-nat-rules"], - arg_group="Properties", - help="Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules.", - ) - _args_schema.load_balancing_rules = AAZListArg( - options=["--load-balancing-rules"], - arg_group="Properties", - help="Object collection representing the load balancing rules Gets the provisioning.", - ) - _args_schema.outbound_nat_rules = AAZListArg( - options=["--outbound-nat-rules"], - arg_group="Properties", - help="The outbound NAT rules.", - ) - _args_schema.probes = AAZListArg( - options=["--probes"], - arg_group="Properties", - help="Collection of probe objects used in the load balancer.", - ) - - backend_address_pools = cls._args_schema.backend_address_pools - backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_schema.backend_address_pools.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resource.", - ) - - inbound_nat_pools = cls._args_schema.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectArg() - - _element = cls._args_schema.inbound_nat_pools.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource.", - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port_range_end = AAZIntArg( - options=["frontend-port-range-end"], - help="The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535.", - ) - _element.frontend_port_range_start = AAZIntArg( - options=["frontend-port-range-start"], - help="The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The reference to the transport protocol used by the inbound NAT pool.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - inbound_nat_rules = cls._args_schema.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_schema.inbound_nat_rules.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource.", - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The reference to the transport protocol used by the load balancing rule.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - load_balancing_rules = cls._args_schema.load_balancing_rules - load_balancing_rules.Element = AAZObjectArg() - - _element = cls._args_schema.load_balancing_rules.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of load balancing rules used by the load balancer. This name can be used to access the resource.", - ) - _element.backend_address_pool = AAZObjectArg( - options=["backend-address-pool"], - help="A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs.", - ) - cls._build_args_sub_resource_create(_element.backend_address_pool) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables \"Any Port\".", - ) - _element.disable_outbound_snat = AAZBoolArg( - options=["disable-outbound-snat"], - help="Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["floating-ip", "enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables \"Any Port\".", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout", "idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.load_distribution = AAZStrArg( - options=["load-distribution"], - help="The load distribution policy for this rule.", - enum={"Default": "Default", "SourceIP": "SourceIP", "SourceIPProtocol": "SourceIPProtocol"}, - ) - _element.probe = AAZObjectArg( - options=["probe"], - help="The reference to the load balancer probe used by the load balancing rule.", - ) - cls._build_args_sub_resource_create(_element.probe) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The reference to the transport protocol used by the load balancing rule.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - outbound_nat_rules = cls._args_schema.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_schema.outbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.allocated_outbound_ports = AAZIntArg( - options=["allocated-outbound-ports"], - help="The number of outbound ports to be used for NAT.", - ) - _element.backend_address_pool = AAZObjectArg( - options=["backend-address-pool"], - help="A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs.", - ) - cls._build_args_sub_resource_create(_element.backend_address_pool) - _element.frontend_ip_configurations = AAZListArg( - options=["frontend-ip-configurations"], - help="The Frontend IP addresses of the load balancer.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - frontend_ip_configurations = cls._args_schema.outbound_nat_rules.Element.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectArg() - cls._build_args_sub_resource_create(frontend_ip_configurations.Element) - - probes = cls._args_schema.probes - probes.Element = AAZObjectArg() - - _element = cls._args_schema.probes.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of probes used by the load balancer. This name can be used to access the resource.", - ) - _element.interval_in_seconds = AAZIntArg( - options=["interval", "interval-in-seconds"], - help={"short-summary": "The interval, in seconds, for how frequently to probe the endpoint for health status.", "long-summary": "Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5."}, - ) - _element.number_of_probes = AAZIntArg( - options=["threshold", "number-of-probes"], - help={"short-summary": "The number of consecutive probe failures before an instance is deemed unhealthy.", "long-summary": "This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure."}, - ) - _element.port = AAZIntArg( - options=["port"], - help="The port for communicating the probe. Possible values range from 1 to 65535, inclusive.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help={"short-summary": "The protocol of the end point.", "long-summary": "If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful."}, - enum={"Http": "Http", "Tcp": "Tcp"}, - ) - _element.request_path = AAZStrArg( - options=["path", "request-path"], - help="The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed.", - ) - return cls._args_schema - - _args_application_security_group_create = None - - @classmethod - def _build_args_application_security_group_create(cls, _schema): - if cls._args_application_security_group_create is not None: - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - return - - cls._args_application_security_group_create = AAZObjectArg() - - application_security_group_create = cls._args_application_security_group_create - application_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - security_rule_create.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - security_rule_create.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_create.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - - _args_sub_resource_create = None - - @classmethod - def _build_args_sub_resource_create(cls, _schema): - if cls._args_sub_resource_create is not None: - _schema.id = cls._args_sub_resource_create.id - return - - cls._args_sub_resource_create = AAZObjectArg() - - sub_resource_create = cls._args_sub_resource_create - sub_resource_create.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - - _schema.id = cls._args_sub_resource_create.id - - def _execute_operations(self): - self.pre_operations() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("sku", AAZObjectType, ".sku") - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendAddressPools", AAZListType, ".backend_address_pools") - properties.set_prop("inboundNatPools", AAZListType, ".inbound_nat_pools") - properties.set_prop("inboundNatRules", AAZListType, ".inbound_nat_rules") - properties.set_prop("loadBalancingRules", AAZListType, ".load_balancing_rules") - properties.set_prop("outboundNatRules", AAZListType, ".outbound_nat_rules") - properties.set_prop("probes", AAZListType, ".probes") - - backend_address_pools = _builder.get(".properties.backendAddressPools") - if backend_address_pools is not None: - backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.backendAddressPools[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - inbound_nat_pools = _builder.get(".properties.inboundNatPools") - if inbound_nat_pools is not None: - inbound_nat_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.inboundNatPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.inboundNatPools[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port", typ_kwargs={"flags": {"required": True}}) - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPortRangeEnd", AAZIntType, ".frontend_port_range_end", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("frontendPortRangeStart", AAZIntType, ".frontend_port_range_start", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - inbound_nat_rules = _builder.get(".properties.inboundNatRules") - if inbound_nat_rules is not None: - inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.inboundNatRules[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.inboundNatRules[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - - load_balancing_rules = _builder.get(".properties.loadBalancingRules") - if load_balancing_rules is not None: - load_balancing_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancingRules[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancingRules[].properties") - if properties is not None: - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("backendAddressPool", AAZObjectType, ".backend_address_pool")) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("disableOutboundSnat", AAZBoolType, ".disable_outbound_snat") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("loadDistribution", AAZStrType, ".load_distribution") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("probe", AAZObjectType, ".probe")) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - outbound_nat_rules = _builder.get(".properties.outboundNatRules") - if outbound_nat_rules is not None: - outbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.outboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.outboundNatRules[].properties") - if properties is not None: - properties.set_prop("allocatedOutboundPorts", AAZIntType, ".allocated_outbound_ports") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("backendAddressPool", AAZObjectType, ".backend_address_pool", typ_kwargs={"flags": {"required": True}})) - properties.set_prop("frontendIPConfigurations", AAZListType, ".frontend_ip_configurations") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - frontend_ip_configurations = _builder.get(".properties.outboundNatRules[].properties.frontendIPConfigurations") - if frontend_ip_configurations is not None: - _CreateHelper._build_schema_sub_resource_create(frontend_ip_configurations.set_elements(AAZObjectType, ".")) - - probes = _builder.get(".properties.probes") - if probes is not None: - probes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.probes[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.probes[].properties") - if properties is not None: - properties.set_prop("intervalInSeconds", AAZIntType, ".interval_in_seconds") - properties.set_prop("numberOfProbes", AAZIntType, ".number_of_probes") - properties.set_prop("port", AAZIntType, ".port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("requestPath", AAZStrType, ".request_path") - - sku = _builder.get(".sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".name") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.location = AAZStrType() - _schema_on_200_201.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200_201.sku = AAZObjectType() - _schema_on_200_201.tags = AAZDictType() - _schema_on_200_201.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = cls._schema_on_200_201.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - _CreateHelper._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = cls._schema_on_200_201.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = cls._schema_on_200_201.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _CreateHelper._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _CreateHelper._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = cls._schema_on_200_201.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = cls._schema_on_200_201.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200_201.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = cls._schema_on_200_201.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = cls._schema_on_200_201.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = cls._schema_on_200_201.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _CreateHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = cls._schema_on_200_201.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _CreateHelper._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200_201.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - _CreateHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _CreateHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = cls._schema_on_200_201.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - _CreateHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = cls._schema_on_200_201.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = cls._schema_on_200_201.properties.probes - probes.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = cls._schema_on_200_201.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = cls._schema_on_200_201.sku - sku.name = AAZStrType() - - tags = cls._schema_on_200_201.tags - tags.Element = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_application_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_sub_resource_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_delete.py deleted file mode 100644 index 417ab5e7338..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb delete", -) -class Delete(AAZCommand): - """Delete the specified load balancer. - - :example: Delete a load balancer. - az network lb delete -g MyResourceGroup -n MyLb - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.LoadBalancersDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class LoadBalancersDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_list.py deleted file mode 100644 index dc79ee939e8..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_list.py +++ /dev/null @@ -1,1608 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb list", -) -class List(AAZCommand): - """List load balancers. - - :example: List load balancers. - az network lb list -g MyResourceGroup - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/loadbalancers", "2017-10-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.LoadBalancersList(ctx=self.ctx)() - if condition_1: - self.LoadBalancersListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class LoadBalancersList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.sku = AAZObjectType() - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = cls._schema_on_200.value.Element.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - _ListHelper._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = cls._schema_on_200.value.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _ListHelper._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _ListHelper._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = cls._schema_on_200.value.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ListHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = cls._schema_on_200.value.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _ListHelper._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - _ListHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ListHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = cls._schema_on_200.value.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - _ListHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = cls._schema_on_200.value.Element.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = cls._schema_on_200.value.Element.properties.probes - probes.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = cls._schema_on_200.value.Element.sku - sku.name = AAZStrType() - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - class LoadBalancersListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.sku = AAZObjectType() - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = cls._schema_on_200.value.Element.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - _ListHelper._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = cls._schema_on_200.value.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _ListHelper._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _ListHelper._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = cls._schema_on_200.value.Element.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = cls._schema_on_200.value.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ListHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = cls._schema_on_200.value.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _ListHelper._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - _ListHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ListHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = cls._schema_on_200.value.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - _ListHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = cls._schema_on_200.value.Element.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = cls._schema_on_200.value.Element.properties.probes - probes.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = cls._schema_on_200.value.Element.sku - sku.name = AAZStrType() - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_list_nic.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_list_nic.py deleted file mode 100644 index dad4b950831..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_list_nic.py +++ /dev/null @@ -1,969 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb list-nic", -) -class ListNic(AAZCommand): - """List associated load balancer network interfaces. - - :example: List associated load balancer network interfaces. - az network lb list-nic -g MyResourceGroup --name MyLb - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}/networkinterfaces", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancerNetworkInterfacesList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class LoadBalancerNetworkInterfacesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListNicHelper._build_schema_network_interface_read(value.Element) - - return cls._schema_on_200 - - -class _ListNicHelper: - """Helper class for ListNic""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["ListNic"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_show.py deleted file mode 100644 index 4df6ffa55e5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_show.py +++ /dev/null @@ -1,1253 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb show", -) -class Show(AAZCommand): - """Get the details of a load balancer. - - :example: Get the details of a load balancer. - az network lb show -g MyResourceGroup -n MyLb - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.sku = AAZObjectType() - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = cls._schema_on_200.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - _ShowHelper._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = cls._schema_on_200.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _ShowHelper._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _ShowHelper._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = cls._schema_on_200.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = cls._schema_on_200.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ShowHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = cls._schema_on_200.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _ShowHelper._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - _ShowHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ShowHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = cls._schema_on_200.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - _ShowHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = cls._schema_on_200.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = cls._schema_on_200.properties.probes - probes.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = cls._schema_on_200.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = cls._schema_on_200.sku - sku.name = AAZStrType() - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_update.py deleted file mode 100644 index 1bcb6eae8d7..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_update.py +++ /dev/null @@ -1,1895 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb update", -) -class Update(AAZCommand): - """Update a load balancer. - - This command can only be used to update the tags for a load balancer. Name and resource group are immutable and cannot be updated. - - :example: Update the tags of a load balancer. - az network lb update -g MyResourceGroup -n MyLB --tags CostCenter=MyTestGroup - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.outbound_nat_rules = AAZListArg( - options=["--outbound-nat-rules"], - arg_group="Properties", - help="The outbound NAT rules.", - nullable=True, - ) - _args_schema.probes = AAZListArg( - options=["--probes"], - arg_group="Properties", - help="Collection of probe objects used in the load balancer.", - nullable=True, - ) - - outbound_nat_rules = cls._args_schema.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.outbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.allocated_outbound_ports = AAZIntArg( - options=["allocated-outbound-ports"], - help="The number of outbound ports to be used for NAT.", - nullable=True, - ) - _element.backend_address_pool = AAZObjectArg( - options=["backend-address-pool"], - help="A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.backend_address_pool) - _element.frontend_ip_configurations = AAZListArg( - options=["frontend-ip-configurations"], - help="The Frontend IP addresses of the load balancer.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - frontend_ip_configurations = cls._args_schema.outbound_nat_rules.Element.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_sub_resource_update(frontend_ip_configurations.Element) - - probes = cls._args_schema.probes - probes.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.probes.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of probes used by the load balancer. This name can be used to access the resource.", - nullable=True, - ) - _element.interval_in_seconds = AAZIntArg( - options=["interval", "interval-in-seconds"], - help={"short-summary": "The interval, in seconds, for how frequently to probe the endpoint for health status.", "long-summary": "Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5."}, - nullable=True, - ) - _element.number_of_probes = AAZIntArg( - options=["threshold", "number-of-probes"], - help={"short-summary": "The number of consecutive probe failures before an instance is deemed unhealthy.", "long-summary": "This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure."}, - nullable=True, - ) - _element.port = AAZIntArg( - options=["port"], - help="The port for communicating the probe. Possible values range from 1 to 65535, inclusive.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help={"short-summary": "The protocol of the end point.", "long-summary": "If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful."}, - enum={"Http": "Http", "Tcp": "Tcp"}, - ) - _element.request_path = AAZStrArg( - options=["path", "request-path"], - help="The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed.", - nullable=True, - ) - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("outboundNatRules", AAZListType, ".outbound_nat_rules") - properties.set_prop("probes", AAZListType, ".probes") - - outbound_nat_rules = _builder.get(".properties.outboundNatRules") - if outbound_nat_rules is not None: - outbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.outboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.outboundNatRules[].properties") - if properties is not None: - properties.set_prop("allocatedOutboundPorts", AAZIntType, ".allocated_outbound_ports") - _UpdateHelper._build_schema_sub_resource_update(properties.set_prop("backendAddressPool", AAZObjectType, ".backend_address_pool", typ_kwargs={"flags": {"required": True}})) - properties.set_prop("frontendIPConfigurations", AAZListType, ".frontend_ip_configurations") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - frontend_ip_configurations = _builder.get(".properties.outboundNatRules[].properties.frontendIPConfigurations") - if frontend_ip_configurations is not None: - _UpdateHelper._build_schema_sub_resource_update(frontend_ip_configurations.set_elements(AAZObjectType, ".")) - - probes = _builder.get(".properties.probes") - if probes is not None: - probes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.probes[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.probes[].properties") - if properties is not None: - properties.set_prop("intervalInSeconds", AAZIntType, ".interval_in_seconds") - properties.set_prop("numberOfProbes", AAZIntType, ".number_of_probes") - properties.set_prop("port", AAZIntType, ".port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("requestPath", AAZStrType, ".request_path") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_wait.py deleted file mode 100644 index cb724a02073..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/_wait.py +++ /dev/null @@ -1,1249 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.sku = AAZObjectType() - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = cls._schema_on_200.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - _WaitHelper._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = cls._schema_on_200.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _WaitHelper._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _WaitHelper._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = cls._schema_on_200.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = cls._schema_on_200.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = cls._schema_on_200.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _WaitHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = cls._schema_on_200.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _WaitHelper._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - _WaitHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _WaitHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = cls._schema_on_200.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - _WaitHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = cls._schema_on_200.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = cls._schema_on_200.properties.probes - probes.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = cls._schema_on_200.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = cls._schema_on_200.sku - sku.name = AAZStrType() - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/__cmd_group.py deleted file mode 100644 index cf0d53eb3e1..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb address-pool", -) -class __CMDGroup(AAZCommandGroup): - """Manage address pools of a load balancer. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/__init__.py deleted file mode 100644 index 2d1a2078686..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/_create.py deleted file mode 100644 index 4e06d505bc7..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/_create.py +++ /dev/null @@ -1,1446 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb address-pool create", -) -class Create(AAZCommand): - """Create an address pool. - - :example: Create an address pool. - az network lb address-pool create -g MyResourceGroup --lb-name MyLb -n MyAddressPool - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.backendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.address_pool_name = AAZStrArg( - options=["-n", "--name", "--address-pool-name"], - help="The name of the backend address pool.", - required=True, - ) - - # define Arg Group "Parameters.properties.backendAddressPools[]" - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".address_pool_name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/_delete.py deleted file mode 100644 index b7e2861ec02..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/_delete.py +++ /dev/null @@ -1,1428 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb address-pool delete", -) -class Delete(AAZCommand): - """Delete an address pool. - - :example: Delete an address pool. - az network lb address-pool delete -g MyResourceGroup --lb-name MyLb -n MyAddressPool - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.backendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.address_pool_name = AAZStrArg( - options=["-n", "--name", "--address-pool-name"], - help="The name of the backend address pool.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/_list.py deleted file mode 100644 index 96a37f9ff72..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/_list.py +++ /dev/null @@ -1,1284 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb address-pool list", -) -class List(AAZCommand): - """List address pools. - - :example: List address pools. - az network lb address-pool list -g MyResourceGroup --lb-name MyLb - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.backendAddressPools"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.backendAddressPools - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.backendAddressPools = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/_show.py deleted file mode 100644 index 2fe8ad7253b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/_show.py +++ /dev/null @@ -1,1303 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb address-pool show", -) -class Show(AAZCommand): - """Get the details of an address pool. - - :example: Get the details of an address pool. - az network lb address-pool show -g MyResourceGroup --lb-name MyLb -n MyAddressPool - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.backendAddressPools[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.address_pool_name = AAZStrArg( - options=["-n", "--name", "--address-pool-name"], - help="The name of the backend address pool.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/_wait.py deleted file mode 100644 index 17bf2ec5826..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/address_pool/_wait.py +++ /dev/null @@ -1,1269 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb address-pool wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.backendAddressPools[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/__cmd_group.py deleted file mode 100644 index 80debcfe9ee..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb frontend-ip", -) -class __CMDGroup(AAZCommandGroup): - """Manage frontend IP addresses of a load balancer. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_create.py deleted file mode 100644 index f1a07b34faa..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_create.py +++ /dev/null @@ -1,1759 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip create", -) -class Create(AAZCommand): - """Create a frontend IP address. - - :example: Create a frontend ip address for a public load balancer. - az network lb frontend-ip create -g MyResourceGroup -n MyFrontendIp --lb-name MyLb --public-ip-address MyFrontendIp - - :example: Create a frontend ip address for an internal load balancer. - az network lb frontend-ip create -g MyResourceGroup -n MyFrontendIp --lb-name MyLb --private-ip-address 10.10.10.100 --subnet MySubnet --vnet-name MyVnet - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.frontendIPConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the frontend IP configuration.", - required=True, - ) - - # define Arg Group "Parameters.properties.frontendIPConfigurations[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="Properties", - help="Static private IP address to associate with the configuration.", - ) - _args_schema.private_ip_allocation_method = AAZStrArg( - options=["--private-ip-allocation-method"], - arg_group="Properties", - help="The Private IP allocation method.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="Properties", - help="Name or ID of the existing public IP to associate with the configuration.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - _args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="Properties", - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}", - ), - ) - _args_schema.zones = AAZListArg( - options=["-z", "--zone", "--zones"], - arg_group="Properties", - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - ) - - zones = cls._args_schema.zones - zones.Element = AAZStrArg() - - # define Arg Group "PublicIpAddress" - - # define Arg Group "Subnet" - - # define Arg Group "Subnets" - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg() - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg() - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType) - properties.set_prop("subnet", AAZObjectType) - - public_ip_address = _builder.get(".properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".public_ip_address") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - subnet = _builder.get(".properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - zones = _builder.get(".zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_delete.py deleted file mode 100644 index 5baddc22e30..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_delete.py +++ /dev/null @@ -1,1428 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip delete", -) -class Delete(AAZCommand): - """Delete a frontend IP address. - - :example: Delete a frontend IP address. - az network lb frontend-ip delete -g MyResourceGroup --lb-name MyLb -n MyFrontendIp - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.frontendIPConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the frontend IP configuration.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_list.py deleted file mode 100644 index 916c87094b6..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_list.py +++ /dev/null @@ -1,1284 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip list", -) -class List(AAZCommand): - """List frontend IP addresses. - - :example: List frontend IP addresses. - az network lb frontend-ip list -g MyResourceGroup --lb-name MyLb - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.frontendIPConfigurations"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.frontendIPConfigurations - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.frontendIPConfigurations = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_show.py deleted file mode 100644 index 1ee479c76cf..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_show.py +++ /dev/null @@ -1,1303 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip show", -) -class Show(AAZCommand): - """Get the details of a frontend IP address. - - :example: Get the details of a frontend IP address. - az network lb frontend-ip show -g MyResourceGroup --lb-name MyLb -n MyFrontendIp - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.frontendIPConfigurations[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the frontend IP configuration.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_update.py deleted file mode 100644 index 50809db9bc4..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_update.py +++ /dev/null @@ -1,1814 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip update", -) -class Update(AAZCommand): - """Update a frontend IP address. - - :example: Update the frontend IP address of a public load balancer. - az network lb frontend-ip update -g MyResourceGroup --lb-name MyLb -n MyFrontendIp --public-ip-address MyNewPublicIp - - :example: Update the frontend IP address of an internal load balancer. - az network lb frontend-ip update -g MyResourceGroup --lb-name MyLb -n MyFrontendIp --private-ip-address 10.10.10.50 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.frontendIPConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the frontend IP configuration.", - required=True, - ) - - # define Arg Group "Parameters.properties.frontendIPConfigurations[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="Properties", - help="Static private IP address to associate with the configuration.", - nullable=True, - ) - _args_schema.private_ip_allocation_method = AAZStrArg( - options=["--private-ip-allocation-method"], - arg_group="Properties", - help="The Private IP allocation method.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="Properties", - help="Name or ID of the existing public IP to associate with the configuration.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - _args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="Properties", - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}", - ), - ) - _args_schema.zones = AAZListArg( - options=["-z", "--zone", "--zones"], - arg_group="Properties", - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - nullable=True, - ) - - zones = cls._args_schema.zones - zones.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "PublicIpAddress" - - # define Arg Group "Subnet" - - # define Arg Group "Subnets" - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType) - properties.set_prop("subnet", AAZObjectType) - - public_ip_address = _builder.get(".properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".public_ip_address") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - subnet = _builder.get(".properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - zones = _builder.get(".zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_wait.py deleted file mode 100644 index 8d1b0eee124..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/frontend_ip/_wait.py +++ /dev/null @@ -1,1269 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.frontendIPConfigurations[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/__cmd_group.py deleted file mode 100644 index 8c9b57a8e8a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb inbound-nat-pool", -) -class __CMDGroup(AAZCommandGroup): - """Manage inbound NAT address pools of a load balancer. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_create.py deleted file mode 100644 index 99824dd8b6b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_create.py +++ /dev/null @@ -1,1486 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool create", -) -class Create(AAZCommand): - """Create an inbound NAT address pool. - - :example: Create an inbound NAT address pool. - az network lb inbound-nat-pool create -g MyResourceGroup --lb-name MyLb -n MyNatPool --protocol Tcp --frontend-port-range-start 80 --frontend-port-range-end 89 --backend-port 80 --frontend-ip MyFrontendIp - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.inboundNatPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource.", - required=True, - ) - - # define Arg Group "Parameters.properties.inboundNatPools[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535.", - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name or ID of the frontend IP configuration.", - ) - _args_schema.frontend_port_range_end = AAZIntArg( - options=["--frontend-port-range-end"], - arg_group="Properties", - help="The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535.", - ) - _args_schema.frontend_port_range_start = AAZIntArg( - options=["--frontend-port-range-start"], - arg_group="Properties", - help="The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the inbound NAT pool.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPortRangeEnd", AAZIntType, ".frontend_port_range_end", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("frontendPortRangeStart", AAZIntType, ".frontend_port_range_start", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_delete.py deleted file mode 100644 index f795947069c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_delete.py +++ /dev/null @@ -1,1428 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool delete", -) -class Delete(AAZCommand): - """Delete an inbound NAT address pool. - - :example: Delete an inbound NAT address pool. - az network lb inbound-nat-pool delete -g MyResourceGroup --lb-name MyLb -n MyNatPool - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.inboundNatPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_list.py deleted file mode 100644 index 35b51d5af99..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_list.py +++ /dev/null @@ -1,1284 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool list", -) -class List(AAZCommand): - """List inbound NAT address pools. - - :example: List inbound NAT address pools. - az network lb inbound-nat-pool list -g MyResourceGroup --lb-name MyLb - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.inboundNatPools"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.inboundNatPools - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.inboundNatPools = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_show.py deleted file mode 100644 index a8d19023aa5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_show.py +++ /dev/null @@ -1,1303 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool show", -) -class Show(AAZCommand): - """Get the details of an inbound NAT address pool. - - :example: Get the details of an inbound NAT address pool. - az network lb inbound-nat-pool show -g MyResourceGroup --lb-name MyLb -n MyNatPool - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.inboundNatPools[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_update.py deleted file mode 100644 index de9c5c975b6..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_update.py +++ /dev/null @@ -1,1502 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool update", -) -class Update(AAZCommand): - """Update an inbound NAT address pool. - - :example: Update an inbound NAT address pool to a different backend port. - az network lb inbound-nat-pool update -g MyResourceGroup --lb-name MyLb -n MyNatPool --protocol Tcp --backend-port 8080 - - :example: Update an inbound NAT address pool. - az network lb inbound-nat-pool update --backend-port 8080 --enable-tcp-reset true --frontend-port-range-end 89 --frontend-port-range-start 80 --lb-name MyLb --name MyNatPool --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.inboundNatPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource.", - required=True, - ) - - # define Arg Group "Parameters.properties.inboundNatPools[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535.", - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name or ID of the frontend IP configuration.", - nullable=True, - ) - _args_schema.frontend_port_range_end = AAZIntArg( - options=["--frontend-port-range-end"], - arg_group="Properties", - help="The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535.", - ) - _args_schema.frontend_port_range_start = AAZIntArg( - options=["--frontend-port-range-start"], - arg_group="Properties", - help="The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the inbound NAT pool.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPortRangeEnd", AAZIntType, ".frontend_port_range_end", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("frontendPortRangeStart", AAZIntType, ".frontend_port_range_start", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_wait.py deleted file mode 100644 index 60c8289b9b7..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_pool/_wait.py +++ /dev/null @@ -1,1269 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.inboundNatPools[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/__cmd_group.py deleted file mode 100644 index a55f1585dd7..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb inbound-nat-rule", -) -class __CMDGroup(AAZCommandGroup): - """Manage inbound NAT rules of a load balancer. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_create.py deleted file mode 100644 index 705b00ac12a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_create.py +++ /dev/null @@ -1,1495 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule create", -) -class Create(AAZCommand): - """Create an inbound NAT rule. - - :example: Create a basic inbound NAT rule for port 80. - az network lb inbound-nat-rule create -g MyResourceGroup --lb-name MyLb -n MyNatRule --protocol Tcp --frontend-port 80 --backend-port 80 - - :example: Create a basic inbound NAT rule for a specific frontend IP and enable floating IP for NAT Rule. - az network lb inbound-nat-rule create -g MyResourceGroup --lb-name MyLb -n MyNatRule --protocol Tcp --frontend-port 5432 --backend-port 3389 --frontend-ip MyFrontendIp --floating-ip true - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.inboundNatRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer.", - required=True, - ) - - # define Arg Group "Parameters.properties.inboundNatRules[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _args_schema.enable_floating_ip = AAZBoolArg( - options=["--floating-ip", "--enable-floating-ip"], - arg_group="Properties", - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name of ID of the frontend IP configuration.", - ) - _args_schema.frontend_port = AAZIntArg( - options=["--frontend-port"], - arg_group="Properties", - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the load balancing rule.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_delete.py deleted file mode 100644 index 20b9396e280..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_delete.py +++ /dev/null @@ -1,1428 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule delete", -) -class Delete(AAZCommand): - """Delete an inbound NAT rule. - - :example: Delete an inbound NAT rule. - az network lb inbound-nat-rule delete -g MyResourceGroup --lb-name MyLb -n MyNatRule - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.inboundNatRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_list.py deleted file mode 100644 index 6f4686df576..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_list.py +++ /dev/null @@ -1,1284 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule list", -) -class List(AAZCommand): - """List inbound NAT rules. - - :example: List inbound NAT rules. - az network lb inbound-nat-rule list -g MyResourceGroup --lb-name MyLb - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.inboundNatRules"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.inboundNatRules - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.inboundNatRules = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_show.py deleted file mode 100644 index 08ee88dfb76..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_show.py +++ /dev/null @@ -1,1303 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule show", -) -class Show(AAZCommand): - """Get the details of an inbound NAT rule. - - :example: Get the details of an inbound NAT rule. - az network lb inbound-nat-rule show -g MyResourceGroup --lb-name MyLb -n MyNatRule - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.inboundNatRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_update.py deleted file mode 100644 index 360c14e8dcb..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_update.py +++ /dev/null @@ -1,1510 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule update", -) -class Update(AAZCommand): - """Update an inbound NAT rule. - - :example: Update an inbound NAT rule to disable floating IP and modify idle timeout duration. - az network lb inbound-nat-rule update -g MyResourceGroup --lb-name MyLb -n MyNatRule --floating-ip false --idle-timeout 5 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.inboundNatRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer.", - required=True, - ) - - # define Arg Group "Parameters.properties.inboundNatRules[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - nullable=True, - ) - _args_schema.enable_floating_ip = AAZBoolArg( - options=["--floating-ip", "--enable-floating-ip"], - arg_group="Properties", - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name of ID of the frontend IP configuration.", - nullable=True, - ) - _args_schema.frontend_port = AAZIntArg( - options=["--frontend-port"], - arg_group="Properties", - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - nullable=True, - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the load balancing rule.", - nullable=True, - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_wait.py deleted file mode 100644 index 784e873c78e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/inbound_nat_rule/_wait.py +++ /dev/null @@ -1,1269 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.inboundNatRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/__cmd_group.py deleted file mode 100644 index 2cf6c0a3e84..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb probe", -) -class __CMDGroup(AAZCommandGroup): - """Evaluate probe information and define routing rules. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_create.py deleted file mode 100644 index 6ba1774c914..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_create.py +++ /dev/null @@ -1,1485 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe create", -) -class Create(AAZCommand): - """Create a probe in the load balance. - - :example: Create a probe on a load balancer over HTTP and port 80. - az network lb probe create -g MyResourceGroup --lb-name MyLb -n MyProbe --protocol http --port 80 --path / - - :example: Create a probe on a load balancer over TCP on port 443. - az network lb probe create -g MyResourceGroup --lb-name MyLb -n MyProbe --protocol tcp --port 443 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.probes[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the probe.", - required=True, - ) - - # define Arg Group "Parameters.properties.probes[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.interval_in_seconds = AAZIntArg( - options=["--interval", "--interval-in-seconds"], - arg_group="Properties", - help={"short-summary": "The interval, in seconds, for how frequently to probe the endpoint for health status.", "long-summary": "Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5."}, - ) - _args_schema.number_of_probes = AAZIntArg( - options=["--threshold", "--number-of-probes"], - arg_group="Properties", - help={"short-summary": "The number of consecutive probe failures before an instance is deemed unhealthy.", "long-summary": "This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure."}, - ) - _args_schema.port = AAZIntArg( - options=["--port"], - arg_group="Properties", - help="The port for communicating the probe. Possible values range from 1 to 65535, inclusive.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help={"short-summary": "The protocol of the end point.", "long-summary": "If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful."}, - enum={"Http": "Http", "Tcp": "Tcp"}, - ) - _args_schema.request_path = AAZStrArg( - options=["--path", "--request-path"], - arg_group="Properties", - help="The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("intervalInSeconds", AAZIntType, ".interval_in_seconds") - properties.set_prop("numberOfProbes", AAZIntType, ".number_of_probes") - properties.set_prop("port", AAZIntType, ".port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("requestPath", AAZStrType, ".request_path") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_delete.py deleted file mode 100644 index ec63814b840..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_delete.py +++ /dev/null @@ -1,1428 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe delete", -) -class Delete(AAZCommand): - """Delete a probe in the load balancer. - - :example: Delete a probe. - az network lb probe delete -g MyResourceGroup --lb-name MyLb -n MyProbe - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.probes[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the probe.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_list.py deleted file mode 100644 index ec2ce118262..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_list.py +++ /dev/null @@ -1,1284 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe list", -) -class List(AAZCommand): - """List probes in the load balancer. - - :example: List probes - az network lb probe list -g MyResourceGroup --lb-name MyLb - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.probes"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.probes - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.probes = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_show.py deleted file mode 100644 index a6d198b4183..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_show.py +++ /dev/null @@ -1,1303 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe show", -) -class Show(AAZCommand): - """Get the details of a probe in the load balancer. - - :example: Get the details of a probe. - az network lb probe show -g MyResourceGroup --lb-name MyLb -n MyProbe - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.probes[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the probe.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_update.py deleted file mode 100644 index 157c42e2f00..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_update.py +++ /dev/null @@ -1,1497 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe update", -) -class Update(AAZCommand): - """Update a probe in the load balancer. - - :example: Update a probe with a different port and interval. - az network lb probe update -g MyResourceGroup --lb-name MyLb -n MyProbe --port 81 --interval 10 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.probes[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the probe.", - required=True, - ) - - # define Arg Group "Parameters.properties.probes[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.interval_in_seconds = AAZIntArg( - options=["--interval", "--interval-in-seconds"], - arg_group="Properties", - help={"short-summary": "The interval, in seconds, for how frequently to probe the endpoint for health status.", "long-summary": "Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5."}, - nullable=True, - ) - _args_schema.number_of_probes = AAZIntArg( - options=["--threshold", "--number-of-probes"], - arg_group="Properties", - help={"short-summary": "The number of consecutive probe failures before an instance is deemed unhealthy.", "long-summary": "This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure."}, - nullable=True, - ) - _args_schema.port = AAZIntArg( - options=["--port"], - arg_group="Properties", - help="The port for communicating the probe. Possible values range from 1 to 65535, inclusive.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help={"short-summary": "The protocol of the end point.", "long-summary": "If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful."}, - enum={"Http": "Http", "Tcp": "Tcp"}, - ) - _args_schema.request_path = AAZStrArg( - options=["--path", "--request-path"], - arg_group="Properties", - help="The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed.", - nullable=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("intervalInSeconds", AAZIntType, ".interval_in_seconds") - properties.set_prop("numberOfProbes", AAZIntType, ".number_of_probes") - properties.set_prop("port", AAZIntType, ".port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("requestPath", AAZStrType, ".request_path") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_wait.py deleted file mode 100644 index 2996cbb6a17..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/probe/_wait.py +++ /dev/null @@ -1,1269 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.probes[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/__cmd_group.py deleted file mode 100644 index 812e7da7710..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb rule", -) -class __CMDGroup(AAZCommandGroup): - """Manage load balancing rules. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_create.py deleted file mode 100644 index 6802d52e974..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_create.py +++ /dev/null @@ -1,1532 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule create", -) -class Create(AAZCommand): - """Create a load balancing rule. - - :example: Create a load balancing rule that assigns a front-facing IP configuration and port to an address pool and port. - az network lb rule create -g MyResourceGroup --lb-name MyLb -n MyLbRule --protocol Tcp --frontend-ip MyFrontEndIp --frontend-port 80 --backend-pool-name MyAddressPool --backend-port 80 - - :example: Create a load balancing rule that assigns a front-facing IP configuration and port to an address pool and port with the floating ip feature. - az network lb rule create -g MyResourceGroup --lb-name MyLb -n MyLbRule --protocol Tcp --frontend-ip MyFrontEndIp --backend-pool-name MyAddressPool --floating-ip true --frontend-port 80 --backend-port 80 - - :example: Create an HA ports load balancing rule that assigns a frontend IP and port to use all available backend IPs in a pool on the same port. - az network lb rule create -g MyResourceGroup --lb-name MyLb -n MyHAPortsRule --protocol All --frontend-port 0 --backend-port 0 --frontend-ip MyFrontendIp --backend-pool-name MyAddressPool - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.loadBalancingRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the load balancing rule.", - required=True, - ) - - # define Arg Group "Parameters.properties.loadBalancingRules[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_address_pool = AAZStrArg( - options=["--backend-pool-name", "--backend-address-pool"], - arg_group="Properties", - help="The name or ID of the backend address pool", - ) - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables \"Any Port\".", - ) - _args_schema.disable_outbound_snat = AAZBoolArg( - options=["--disable-outbound-snat"], - arg_group="Properties", - help="Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule.", - ) - _args_schema.enable_floating_ip = AAZBoolArg( - options=["--floating-ip", "--enable-floating-ip"], - arg_group="Properties", - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name of ID of the frontend IP configuration.", - ) - _args_schema.frontend_port = AAZIntArg( - options=["--frontend-port"], - arg_group="Properties", - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables \"Any Port\".", - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _args_schema.load_distribution = AAZStrArg( - options=["--load-distribution"], - arg_group="Properties", - help="The load distribution policy for this rule.", - default="Default", - enum={"Default": "Default", "SourceIP": "SourceIP", "SourceIPProtocol": "SourceIPProtocol"}, - ) - _args_schema.probe_name = AAZStrArg( - options=["--probe", "--probe-name"], - arg_group="Properties", - help="The ID or Name of an existing probe to associate with this rule.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the load balancing rule.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendAddressPool", AAZObjectType) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("disableOutboundSnat", AAZBoolType, ".disable_outbound_snat") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("loadDistribution", AAZStrType, ".load_distribution") - properties.set_prop("probe", AAZObjectType) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - backend_address_pool = _builder.get(".properties.backendAddressPool") - if backend_address_pool is not None: - backend_address_pool.set_prop("id", AAZStrType, ".backend_address_pool") - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - probe = _builder.get(".properties.probe") - if probe is not None: - probe.set_prop("id", AAZStrType, ".probe_name") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_delete.py deleted file mode 100644 index f1a0ddf2766..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_delete.py +++ /dev/null @@ -1,1428 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule delete", -) -class Delete(AAZCommand): - """Delete a load balancing rule. - - :example: Delete a load balancing rule. - az network lb rule delete -g MyResourceGroup --lb-name MyLb -n MyLbRule - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.loadBalancingRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the load balancing rule.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_list.py deleted file mode 100644 index 92bc0ff39f1..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_list.py +++ /dev/null @@ -1,1284 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule list", -) -class List(AAZCommand): - """List load balancing rules. - - :example: List load balancing rules. - az network lb rule list -g MyResourceGroup --lb-name MyLb -o table - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.loadBalancingRules"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.loadBalancingRules - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.loadBalancingRules = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_show.py deleted file mode 100644 index be4adf4e777..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_show.py +++ /dev/null @@ -1,1303 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule show", -) -class Show(AAZCommand): - """Get the details of a load balancing rule. - - :example: Get the details of a load balancing rule. - az network lb rule show -g MyResourceGroup --lb-name MyLb -n MyLbRule - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.loadBalancingRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the load balancing rule.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_update.py deleted file mode 100644 index fef00236882..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_update.py +++ /dev/null @@ -1,1548 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule update", -) -class Update(AAZCommand): - """Update a load balancing rule. - - :example: Update a load balancing rule to change the protocol to UDP. - az network lb rule update -g MyResourceGroup --lb-name MyLb -n MyLbRule --protocol Udp - - :example: Update a load balancing rule to support HA ports. - az network lb rule update -g MyResourceGroup --lb-name MyLb -n MyLbRule --protocol All --frontend-port 0 --backend-port 0 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.loadBalancingRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the load balancing rule.", - required=True, - ) - - # define Arg Group "Parameters.properties.loadBalancingRules[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_address_pool = AAZStrArg( - options=["--backend-pool-name", "--backend-address-pool"], - arg_group="Properties", - help="The name or ID of the backend address pool", - nullable=True, - ) - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables \"Any Port\".", - nullable=True, - ) - _args_schema.disable_outbound_snat = AAZBoolArg( - options=["--disable-outbound-snat"], - arg_group="Properties", - help="Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule.", - nullable=True, - ) - _args_schema.enable_floating_ip = AAZBoolArg( - options=["--floating-ip", "--enable-floating-ip"], - arg_group="Properties", - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name of ID of the frontend IP configuration.", - nullable=True, - ) - _args_schema.frontend_port = AAZIntArg( - options=["--frontend-port"], - arg_group="Properties", - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables \"Any Port\".", - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _args_schema.load_distribution = AAZStrArg( - options=["--load-distribution"], - arg_group="Properties", - help="The load distribution policy for this rule.", - nullable=True, - enum={"Default": "Default", "SourceIP": "SourceIP", "SourceIPProtocol": "SourceIPProtocol"}, - ) - _args_schema.probe_name = AAZStrArg( - options=["--probe", "--probe-name"], - arg_group="Properties", - help="The ID or Name of an existing probe to associate with this rule.", - nullable=True, - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the load balancing rule.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendAddressPool", AAZObjectType) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("disableOutboundSnat", AAZBoolType, ".disable_outbound_snat") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("loadDistribution", AAZStrType, ".load_distribution") - properties.set_prop("probe", AAZObjectType) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - backend_address_pool = _builder.get(".properties.backendAddressPool") - if backend_address_pool is not None: - backend_address_pool.set_prop("id", AAZStrType, ".backend_address_pool") - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - probe = _builder.get(".properties.probe") - if probe is not None: - probe.set_prop("id", AAZStrType, ".probe_name") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_wait.py deleted file mode 100644 index e39496bec92..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/lb/rule/_wait.py +++ /dev/null @@ -1,1269 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2017-10-01", "properties.loadBalancingRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.frontend_ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.zones = AAZListType() - - properties = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rules = AAZListType( - serialized_name="outboundNatRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_nat_rules = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_nat_rules.Element) - - zones = _schema_load_balancer_read.properties.frontend_ip_configurations.Element.zones - zones.Element = AAZStrType() - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_nat_rules = _schema_load_balancer_read.properties.outbound_nat_rules - outbound_nat_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_nat_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/__cmd_group.py deleted file mode 100644 index d8d6d8ce87e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/__cmd_group.py +++ /dev/null @@ -1,26 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 local-gateway", -) -class __CMDGroup(AAZCommandGroup): - """Manage local gateways. - - For more information on local gateways, visit: - https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-cli#localnet. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_create.py deleted file mode 100644 index 0d5252d9750..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_create.py +++ /dev/null @@ -1,333 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway create", -) -class Create(AAZCommand): - """Create a local VPN gateway. - - :example: Create a Local Network Gateway to represent your on-premises site. - az network local-gateway create -g MyResourceGroup -n MyLocalGateway --gateway-ip-address 23.99.221.164 --local-address-prefixes 10.0.0.0/24 20.0.0.0/24 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the local network gateway.", - required=True, - fmt=AAZStrArgFormat( - min_length=1, - ), - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "BGP Peering" - - _args_schema = cls._args_schema - _args_schema.asn = AAZIntArg( - options=["--asn"], - arg_group="BGP Peering", - help="Autonomous System Number to use for the BGP settings.", - ) - _args_schema.bgp_peering_address = AAZStrArg( - options=["--bgp-peering-address"], - arg_group="BGP Peering", - help="IP address from the OnPremise VPN's subnet to use for BGP peering.", - ) - _args_schema.peer_weight = AAZIntArg( - options=["--peer-weight"], - arg_group="BGP Peering", - help="Weight (0-100) added to routes learned through BGP peering.", - ) - - # define Arg Group "LocalNetworkAddressSpace" - - _args_schema = cls._args_schema - _args_schema.local_address_prefixes = AAZListArg( - options=["--address-prefixes", "--local-address-prefixes"], - arg_group="LocalNetworkAddressSpace", - help="List of CIDR block prefixes representing the address space of the OnPremise VPN's subnet.", - ) - - local_address_prefixes = cls._args_schema.local_address_prefixes - local_address_prefixes.Element = AAZStrArg() - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - arg_group="Parameters", - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Parameters", - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.gateway_ip_address = AAZStrArg( - options=["--gateway-ip-address"], - arg_group="Properties", - help="Gateway's public IP address. (e.g. 10.1.1.1).", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.LocalNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LocalNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("bgpSettings", AAZObjectType) - properties.set_prop("gatewayIpAddress", AAZStrType, ".gateway_ip_address") - properties.set_prop("localNetworkAddressSpace", AAZObjectType) - - bgp_settings = _builder.get(".properties.bgpSettings") - if bgp_settings is not None: - bgp_settings.set_prop("asn", AAZIntType, ".asn") - bgp_settings.set_prop("bgpPeeringAddress", AAZStrType, ".bgp_peering_address") - bgp_settings.set_prop("peerWeight", AAZIntType, ".peer_weight") - - local_network_address_space = _builder.get(".properties.localNetworkAddressSpace") - if local_network_address_space is not None: - local_network_address_space.set_prop("addressPrefixes", AAZListType, ".local_address_prefixes") - - address_prefixes = _builder.get(".properties.localNetworkAddressSpace.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.location = AAZStrType() - _schema_on_200_201.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200_201.tags = AAZDictType() - _schema_on_200_201.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - bgp_settings = cls._schema_on_200_201.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - local_network_address_space = cls._schema_on_200_201.properties.local_network_address_space - local_network_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200_201.properties.local_network_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - tags = cls._schema_on_200_201.tags - tags.Element = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_delete.py deleted file mode 100644 index 26ba7ee45b9..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_delete.py +++ /dev/null @@ -1,167 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway delete", -) -class Delete(AAZCommand): - """Delete a local VPN gateway. - - In order to delete a Local Network Gateway, you must first delete ALL Connection objects in Azure that are connected to the Gateway. After deleting the Gateway, proceed to delete other resources now not in use. For more information, follow the order of instructions on this page: https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-delete-vnet-gateway-portal - - :example: Delete a Local Network Gateway. - az network local-gateway delete -g MyResourceGroup -n MyLocalGateway - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the local network gateway.", - required=True, - id_part="name", - fmt=AAZStrArgFormat( - min_length=1, - ), - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.LocalNetworkGatewaysDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class LocalNetworkGatewaysDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_list.py deleted file mode 100644 index 892c27685a9..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_list.py +++ /dev/null @@ -1,215 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway list", -) -class List(AAZCommand): - """List all local VPN gateways in a resource group. - - :example: List all local VPN gateways in a resource group. - az network local-gateway list -g MyResourceGroup - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LocalNetworkGatewaysList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class LocalNetworkGatewaysList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - bgp_settings = cls._schema_on_200.value.Element.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - local_network_address_space = cls._schema_on_200.value.Element.properties.local_network_address_space - local_network_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.value.Element.properties.local_network_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_show.py deleted file mode 100644 index a95229e9cb4..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_show.py +++ /dev/null @@ -1,218 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway show", -) -class Show(AAZCommand): - """Get the details of a local VPN gateway. - - :example: Get the details of a local VPN gateway. - az network local-gateway show -g MyResourceGroup -n MyLocalGateway - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the local network gateway.", - required=True, - id_part="name", - fmt=AAZStrArgFormat( - min_length=1, - ), - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LocalNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LocalNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - bgp_settings = cls._schema_on_200.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - local_network_address_space = cls._schema_on_200.properties.local_network_address_space - local_network_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.local_network_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_update.py deleted file mode 100644 index e831a8168c9..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_update.py +++ /dev/null @@ -1,483 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway update", -) -class Update(AAZCommand): - """Update a local VPN gateway. - - :example: Update a Local Network Gateway provisioned with a 10.0.0.0/24 address prefix with additional prefixes. - az network local-gateway update -g MyResourceGroup -n MyLocalGateway --address-prefixes 10.0.0.0/24 20.0.0.0/24 30.0.0.0/24 - - :example: Update a local VPN gateway. (autogenerated) - az network local-gateway update --gateway-ip-address 23.99.221.164 --name MyLocalGateway --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the local network gateway.", - required=True, - id_part="name", - fmt=AAZStrArgFormat( - min_length=1, - ), - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "BGP Peering" - - _args_schema = cls._args_schema - _args_schema.asn = AAZIntArg( - options=["--asn"], - arg_group="BGP Peering", - help="Autonomous System Number to use for the BGP settings.", - nullable=True, - ) - _args_schema.bgp_peering_address = AAZStrArg( - options=["--bgp-peering-address"], - arg_group="BGP Peering", - help="IP address from the OnPremise VPN's subnet to use for BGP peering.", - nullable=True, - ) - _args_schema.peer_weight = AAZIntArg( - options=["--peer-weight"], - arg_group="BGP Peering", - help="Weight (0-100) added to routes learned through BGP peering.", - nullable=True, - ) - - # define Arg Group "LocalNetworkAddressSpace" - - _args_schema = cls._args_schema - _args_schema.local_address_prefixes = AAZListArg( - options=["--address-prefixes", "--local-address-prefixes"], - arg_group="LocalNetworkAddressSpace", - help="List of CIDR block prefixes representing the address space of the OnPremise VPN's subnet.", - nullable=True, - ) - - local_address_prefixes = cls._args_schema.local_address_prefixes - local_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Parameters", - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.gateway_ip_address = AAZStrArg( - options=["--gateway-ip-address"], - arg_group="Properties", - help="Gateway's public IP address. (e.g. 10.1.1.1).", - nullable=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LocalNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.LocalNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LocalNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_local_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LocalNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_local_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("bgpSettings", AAZObjectType) - properties.set_prop("gatewayIpAddress", AAZStrType, ".gateway_ip_address") - properties.set_prop("localNetworkAddressSpace", AAZObjectType) - - bgp_settings = _builder.get(".properties.bgpSettings") - if bgp_settings is not None: - bgp_settings.set_prop("asn", AAZIntType, ".asn") - bgp_settings.set_prop("bgpPeeringAddress", AAZStrType, ".bgp_peering_address") - bgp_settings.set_prop("peerWeight", AAZIntType, ".peer_weight") - - local_network_address_space = _builder.get(".properties.localNetworkAddressSpace") - if local_network_address_space is not None: - local_network_address_space.set_prop("addressPrefixes", AAZListType, ".local_address_prefixes") - - address_prefixes = _builder.get(".properties.localNetworkAddressSpace.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_local_network_gateway_read = None - - @classmethod - def _build_schema_local_network_gateway_read(cls, _schema): - if cls._schema_local_network_gateway_read is not None: - _schema.etag = cls._schema_local_network_gateway_read.etag - _schema.id = cls._schema_local_network_gateway_read.id - _schema.location = cls._schema_local_network_gateway_read.location - _schema.name = cls._schema_local_network_gateway_read.name - _schema.properties = cls._schema_local_network_gateway_read.properties - _schema.tags = cls._schema_local_network_gateway_read.tags - _schema.type = cls._schema_local_network_gateway_read.type - return - - cls._schema_local_network_gateway_read = _schema_local_network_gateway_read = AAZObjectType() - - local_network_gateway_read = _schema_local_network_gateway_read - local_network_gateway_read.etag = AAZStrType() - local_network_gateway_read.id = AAZStrType() - local_network_gateway_read.location = AAZStrType() - local_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway_read.tags = AAZDictType() - local_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_local_network_gateway_read.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - bgp_settings = _schema_local_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - local_network_address_space = _schema_local_network_gateway_read.properties.local_network_address_space - local_network_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_local_network_gateway_read.properties.local_network_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - tags = _schema_local_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_local_network_gateway_read.etag - _schema.id = cls._schema_local_network_gateway_read.id - _schema.location = cls._schema_local_network_gateway_read.location - _schema.name = cls._schema_local_network_gateway_read.name - _schema.properties = cls._schema_local_network_gateway_read.properties - _schema.tags = cls._schema_local_network_gateway_read.tags - _schema.type = cls._schema_local_network_gateway_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_wait.py deleted file mode 100644 index 79bee40d6bd..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/local_gateway/_wait.py +++ /dev/null @@ -1,214 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the local network gateway.", - required=True, - id_part="name", - fmt=AAZStrArgFormat( - min_length=1, - ), - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LocalNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LocalNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - bgp_settings = cls._schema_on_200.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - local_network_address_space = cls._schema_on_200.properties.local_network_address_space - local_network_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.local_network_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/__cmd_group.py deleted file mode 100644 index fc5808be9b0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 nic", -) -class __CMDGroup(AAZCommandGroup): - """Manage network interfaces. - - To learn more about network interfaces in Azure, visit https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-network-interface?tabs=network-interface-portal. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/__init__.py deleted file mode 100644 index 7b725850ba8..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._list_effective_nsg import * -from ._show import * -from ._show_effective_route_table import * -from ._update import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_create.py deleted file mode 100644 index 5c4512fbe86..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_create.py +++ /dev/null @@ -1,2401 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic create", -) -class Create(AAZCommand): - """Create a network interface. - - :example: Create a network interface for a specified subnet on a specified virtual network. - az network nic create -g MyResourceGroup --vnet-name MyVnet --subnet MySubnet -n MyNic - - :example: Create a network interface for a specified subnet on a virtual network which allows IP forwarding subject to a network security group. - az network nic create -g MyResourceGroup --vnet-name MyVnet --subnet MySubnet -n MyNic --ip-forwarding --network-security-group MyNsg - - :example: Create a network interface for a specified subnet on a virtual network with network security group and application security groups. - az network nic create -g MyResourceGroup --vnet-name MyVnet --subnet MySubnet -n MyNic --network-security-group MyNsg --application-security-groups Web App - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.accelerated_networking = AAZBoolArg( - options=["--accelerated-networking"], - help="Whether to enable accelerated networking.", - ) - _args_schema.ip_forwarding = AAZBoolArg( - options=["--ip-forwarding"], - help="Whether to enable IP forwarding.", - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "DNS" - - _args_schema = cls._args_schema - _args_schema.dns_servers = AAZListArg( - options=["--dns-servers"], - arg_group="DNS", - help="Space-separated list of DNS server IP addresses.", - ) - _args_schema.internal_dns_name = AAZStrArg( - options=["--internal-dns-name"], - arg_group="DNS", - help="Name of internal DNS label.", - ) - - dns_servers = cls._args_schema.dns_servers - dns_servers.Element = AAZStrArg() - - # define Arg Group "DnsSettings" - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.ip_configurations = AAZListArg( - options=["--ip-configurations"], - arg_group="Properties", - help="A list of IPConfigurations of the network interface.", - ) - _args_schema.nsg = AAZObjectArg( - options=["--nsg"], - arg_group="Properties", - help="The reference to the NetworkSecurityGroup resource.", - ) - - ip_configurations = cls._args_schema.ip_configurations - ip_configurations.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}/ipConfigurations/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.application_gateway_backend_address_pools = AAZListArg( - options=["application-gateway-backend-address-pools"], - help="The reference to ApplicationGatewayBackendAddressPool resource.", - ) - _element.application_security_groups = AAZListArg( - options=["application-security-groups"], - help="Application security groups in which the IP configuration is included.", - ) - _element.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference to LoadBalancerBackendAddressPool resource.", - ) - _element.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - ) - _element.primary = AAZBoolArg( - options=["primary"], - help="Whether this is a primary customer address on the network interface.", - ) - _element.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="Private IP address of the IP configuration.", - ) - _element.private_ip_address_version = AAZStrArg( - options=["private-ip-address-version"], - help="Version of private IP address to use.", - default="IPv4", - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Allocation method of private IP address.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address bound to the IP configuration.", - ) - _element.subnet = AAZObjectArg( - options=["subnet"], - help="Subnet bound to the IP configuration.", - ) - - application_gateway_backend_address_pools = cls._args_schema.ip_configurations.Element.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element.application_gateway_backend_address_pools.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the backend address pool that is unique within an Application Gateway.", - ) - _element.backend_addresses = AAZListArg( - options=["backend-addresses"], - help="Backend addresses.", - ) - - backend_addresses = cls._args_schema.ip_configurations.Element.application_gateway_backend_address_pools.Element.backend_addresses - backend_addresses.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element.application_gateway_backend_address_pools.Element.backend_addresses.Element - _element.fqdn = AAZStrArg( - options=["fqdn"], - help="Fully qualified domain name (FQDN).", - ) - _element.ip_address = AAZStrArg( - options=["ip-address"], - help="IP address.", - ) - - application_security_groups = cls._args_schema.ip_configurations.Element.application_security_groups - application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(application_security_groups.Element) - - load_balancer_backend_address_pools = cls._args_schema.ip_configurations.Element.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element.load_balancer_backend_address_pools.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resource.", - ) - - load_balancer_inbound_nat_rules = cls._args_schema.ip_configurations.Element.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element.load_balancer_inbound_nat_rules.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource.", - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The reference to the transport protocol used by the load balancing rule.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - public_ip_address = cls._args_schema.ip_configurations.Element.public_ip_address - public_ip_address.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - ) - public_ip_address.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - ) - public_ip_address.ip_address = AAZStrArg( - options=["ip-address"], - help="The IP address associated with the public IP address resource.", - ) - public_ip_address.public_ip_address_version = AAZStrArg( - options=["public-ip-address-version"], - help="Version of public IP address.", - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - public_ip_address.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP address allocation method.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address.sku = AAZObjectArg( - options=["sku"], - help="The public IP address SKU.", - ) - public_ip_address.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - public_ip_address.zones = AAZListArg( - options=["zones"], - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - ) - - dns_settings = cls._args_schema.ip_configurations.Element.public_ip_address.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="The domain name label. The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="The reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN.", - ) - - sku = cls._args_schema.ip_configurations.Element.public_ip_address.sku - sku.name = AAZStrArg( - options=["name"], - help="Name of a public IP address SKU.", - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - - tags = cls._args_schema.ip_configurations.Element.public_ip_address.tags - tags.Element = AAZStrArg() - - zones = cls._args_schema.ip_configurations.Element.public_ip_address.zones - zones.Element = AAZStrArg() - - subnet = cls._args_schema.ip_configurations.Element.subnet - subnet.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}", - ), - ) - subnet.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - subnet.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - subnet.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_create(subnet.network_security_group) - subnet.resource_navigation_links = AAZListArg( - options=["resource-navigation-links"], - help="Gets an array of references to the external resources using subnet.", - ) - subnet.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - ) - subnet.service_endpoints = AAZListArg( - options=["service-endpoints"], - help="An array of service endpoints.", - ) - - resource_navigation_links = cls._args_schema.ip_configurations.Element.subnet.resource_navigation_links - resource_navigation_links.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element.subnet.resource_navigation_links.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.link = AAZStrArg( - options=["link"], - help="Link to the external resource", - ) - _element.linked_resource_type = AAZStrArg( - options=["linked-resource-type"], - help="Resource type of the linked resource.", - ) - - route_table = cls._args_schema.ip_configurations.Element.subnet.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.disable_bgp_route_propagation = AAZBoolArg( - options=["disable-bgp-route-propagation"], - help="Gets or sets whether to disable the routes learned by BGP on that route table. True means disable.", - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_schema.ip_configurations.Element.subnet.route_table.routes - routes.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element.subnet.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - tags = cls._args_schema.ip_configurations.Element.subnet.route_table.tags - tags.Element = AAZStrArg() - - service_endpoints = cls._args_schema.ip_configurations.Element.subnet.service_endpoints - service_endpoints.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element.subnet.service_endpoints.Element - _element.locations = AAZListArg( - options=["locations"], - help="A list of locations.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - ) - _element.service = AAZStrArg( - options=["service"], - help="The type of the endpoint service.", - ) - - locations = cls._args_schema.ip_configurations.Element.subnet.service_endpoints.Element.locations - locations.Element = AAZStrArg() - - nsg = cls._args_schema.nsg - nsg.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - nsg.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - nsg.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - nsg.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - nsg.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - nsg.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - nsg.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - nsg.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_schema.nsg.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_create(default_security_rules.Element) - - security_rules = cls._args_schema.nsg.security_rules - security_rules.Element = AAZObjectArg() - - _element = cls._args_schema.nsg.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - _element.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.", - ) - _element.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - _element.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_schema.nsg.security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_schema.nsg.security_rules.Element.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_schema.nsg.security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_schema.nsg.security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_schema.nsg.security_rules.Element.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_schema.nsg.security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - tags = cls._args_schema.nsg.tags - tags.Element = AAZStrArg() - return cls._args_schema - - _args_application_security_group_create = None - - @classmethod - def _build_args_application_security_group_create(cls, _schema): - if cls._args_application_security_group_create is not None: - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - return - - cls._args_application_security_group_create = AAZObjectArg() - - application_security_group_create = cls._args_application_security_group_create - application_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - - _args_network_security_group_create = None - - @classmethod - def _build_args_network_security_group_create(cls, _schema): - if cls._args_network_security_group_create is not None: - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.id = cls._args_network_security_group_create.id - _schema.location = cls._args_network_security_group_create.location - _schema.provisioning_state = cls._args_network_security_group_create.provisioning_state - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.tags = cls._args_network_security_group_create.tags - return - - cls._args_network_security_group_create = AAZObjectArg() - - network_security_group_create = cls._args_network_security_group_create - network_security_group_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_create.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - network_security_group_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - network_security_group_create.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - network_security_group_create.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_network_security_group_create.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_create(default_security_rules.Element) - - security_rules = cls._args_network_security_group_create.security_rules - security_rules.Element = AAZObjectArg() - - _element = cls._args_network_security_group_create.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - _element.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - _element.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - _element.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_network_security_group_create.security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_network_security_group_create.security_rules.Element.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_network_security_group_create.security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_network_security_group_create.security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_network_security_group_create.security_rules.Element.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_network_security_group_create.security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - tags = cls._args_network_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.id = cls._args_network_security_group_create.id - _schema.location = cls._args_network_security_group_create.location - _schema.provisioning_state = cls._args_network_security_group_create.provisioning_state - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.tags = cls._args_network_security_group_create.tags - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - security_rule_create.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - security_rule_create.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - security_rule_create.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - security_rule_create.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_create.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - - _args_sub_resource_create = None - - @classmethod - def _build_args_sub_resource_create(cls, _schema): - if cls._args_sub_resource_create is not None: - _schema.id = cls._args_sub_resource_create.id - return - - cls._args_sub_resource_create = AAZObjectArg() - - sub_resource_create = cls._args_sub_resource_create - sub_resource_create.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - - _schema.id = cls._args_sub_resource_create.id - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType) - properties.set_prop("enableAcceleratedNetworking", AAZBoolType, ".accelerated_networking") - properties.set_prop("enableIPForwarding", AAZBoolType, ".ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("networkSecurityGroup", AAZObjectType, ".nsg") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name") - - dns_servers = _builder.get(".properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("applicationGatewayBackendAddressPools", AAZListType, ".application_gateway_backend_address_pools") - properties.set_prop("applicationSecurityGroups", AAZListType, ".application_security_groups") - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAddressVersion", AAZStrType, ".private_ip_address_version") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address") - properties.set_prop("subnet", AAZObjectType, ".subnet") - - application_gateway_backend_address_pools = _builder.get(".properties.ipConfigurations[].properties.applicationGatewayBackendAddressPools") - if application_gateway_backend_address_pools is not None: - application_gateway_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.applicationGatewayBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.applicationGatewayBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("backendAddresses", AAZListType, ".backend_addresses") - - backend_addresses = _builder.get(".properties.ipConfigurations[].properties.applicationGatewayBackendAddressPools[].properties.backendAddresses") - if backend_addresses is not None: - backend_addresses.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.applicationGatewayBackendAddressPools[].properties.backendAddresses[]") - if _elements is not None: - _elements.set_prop("fqdn", AAZStrType, ".fqdn") - _elements.set_prop("ipAddress", AAZStrType, ".ip_address") - - application_security_groups = _builder.get(".properties.ipConfigurations[].properties.applicationSecurityGroups") - if application_security_groups is not None: - _CreateHelper._build_schema_application_security_group_create(application_security_groups.set_elements(AAZObjectType, ".")) - - load_balancer_backend_address_pools = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - load_balancer_inbound_nat_rules = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - - public_ip_address = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".id") - public_ip_address.set_prop("location", AAZStrType, ".location") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - public_ip_address.set_prop("sku", AAZObjectType, ".sku") - public_ip_address.set_prop("tags", AAZDictType, ".tags") - public_ip_address.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("publicIPAddressVersion", AAZStrType, ".public_ip_address_version") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - - dns_settings = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - sku = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".name") - - tags = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - zones = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - subnet = _builder.get(".properties.ipConfigurations[].properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".id") - subnet.set_prop("name", AAZStrType, ".name") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - _CreateHelper._build_schema_network_security_group_create(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("resourceNavigationLinks", AAZListType, ".resource_navigation_links") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - properties.set_prop("serviceEndpoints", AAZListType, ".service_endpoints") - - resource_navigation_links = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.resourceNavigationLinks") - if resource_navigation_links is not None: - resource_navigation_links.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.resourceNavigationLinks[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.resourceNavigationLinks[].properties") - if properties is not None: - properties.set_prop("link", AAZStrType, ".link") - properties.set_prop("linkedResourceType", AAZStrType, ".linked_resource_type") - - route_table = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties") - if properties is not None: - properties.set_prop("disableBgpRoutePropagation", AAZBoolType, ".disable_bgp_route_propagation") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - - routes = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - tags = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - service_endpoints = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.serviceEndpoints") - if service_endpoints is not None: - service_endpoints.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.serviceEndpoints[]") - if _elements is not None: - _elements.set_prop("locations", AAZListType, ".locations") - _elements.set_prop("provisioningState", AAZStrType, ".provisioning_state") - _elements.set_prop("service", AAZStrType, ".service") - - locations = _builder.get(".properties.ipConfigurations[].properties.subnet.properties.serviceEndpoints[].locations") - if locations is not None: - locations.set_elements(AAZStrType, ".") - - network_security_group = _builder.get(".properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("etag", AAZStrType, ".etag") - network_security_group.set_prop("id", AAZStrType, ".id") - network_security_group.set_prop("location", AAZStrType, ".location") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - network_security_group.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkSecurityGroup.properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - - default_security_rules = _builder.get(".properties.networkSecurityGroup.properties.defaultSecurityRules") - if default_security_rules is not None: - _CreateHelper._build_schema_security_rule_create(default_security_rules.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.networkSecurityGroup.properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkSecurityGroup.properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - _CreateHelper._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - _CreateHelper._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.networkSecurityGroup.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_application_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_create(default_security_rules.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.securityRules[].properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.securityRules[].properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.securityRules[].properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.securityRules[].properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.securityRules[].properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.securityRules[].properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_sub_resource_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_delete.py deleted file mode 100644 index 61496b0048f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic delete", -) -class Delete(AAZCommand): - """Delete a network interface. - - :example: Delete a network interface. - az network nic delete -g MyResourceGroup -n MyNic - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkInterfacesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class NetworkInterfacesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_list.py deleted file mode 100644 index c85d412b11a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_list.py +++ /dev/null @@ -1,1052 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic list", -) -class List(AAZCommand): - """List network interfaces. - - To list network interfaces attached to VMs in VM scale sets use `az vmss nic list` or `az vmss nic list-vm-nics`. - - :example: List all NICs by internal DNS suffix. - az network nic list --query "[?dnsSettings.internalDomainNameSuffix=`{dnsSuffix}`]" - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/networkinterfaces", "2017-10-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.NetworkInterfacesList(ctx=self.ctx)() - if condition_1: - self.NetworkInterfacesListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class NetworkInterfacesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_network_interface_read(value.Element) - - return cls._schema_on_200 - - class NetworkInterfacesListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_network_interface_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_list_effective_nsg.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_list_effective_nsg.py deleted file mode 100644 index fc711787f6d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_list_effective_nsg.py +++ /dev/null @@ -1,291 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic list-effective-nsg", -) -class ListEffectiveNsg(AAZCommand): - """List all effective network security groups applied to a network interface. - - To learn more about troubleshooting using effective security rules visit https://learn.microsoft.com/en-us/azure/virtual-network/diagnose-network-traffic-filter-problem. - - :example: List the effective security groups associated with a NIC. - az network nic list-effective-nsg -g MyResourceGroup -n MyNic - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}/effectivenetworksecuritygroups", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkInterfacesListEffectiveNetworkSecurityGroups(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkInterfacesListEffectiveNetworkSecurityGroups(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.association = AAZObjectType() - _element.effective_security_rules = AAZListType( - serialized_name="effectiveSecurityRules", - ) - _element.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - _ListEffectiveNsgHelper._build_schema_sub_resource_read(_element.network_security_group) - _element.tag_map = AAZDictType( - serialized_name="tagMap", - ) - - association = cls._schema_on_200.value.Element.association - association.network_interface = AAZObjectType( - serialized_name="networkInterface", - ) - _ListEffectiveNsgHelper._build_schema_sub_resource_read(association.network_interface) - association.subnet = AAZObjectType() - _ListEffectiveNsgHelper._build_schema_sub_resource_read(association.subnet) - - effective_security_rules = cls._schema_on_200.value.Element.effective_security_rules - effective_security_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.effective_security_rules.Element - _element.access = AAZStrType() - _element.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - _element.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - _element.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - _element.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - _element.direction = AAZStrType() - _element.expanded_destination_address_prefix = AAZListType( - serialized_name="expandedDestinationAddressPrefix", - ) - _element.expanded_source_address_prefix = AAZListType( - serialized_name="expandedSourceAddressPrefix", - ) - _element.name = AAZStrType() - _element.priority = AAZIntType() - _element.protocol = AAZStrType() - _element.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - _element.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - _element.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - _element.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = cls._schema_on_200.value.Element.effective_security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_port_ranges = cls._schema_on_200.value.Element.effective_security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - expanded_destination_address_prefix = cls._schema_on_200.value.Element.effective_security_rules.Element.expanded_destination_address_prefix - expanded_destination_address_prefix.Element = AAZStrType() - - expanded_source_address_prefix = cls._schema_on_200.value.Element.effective_security_rules.Element.expanded_source_address_prefix - expanded_source_address_prefix.Element = AAZStrType() - - source_address_prefixes = cls._schema_on_200.value.Element.effective_security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_port_ranges = cls._schema_on_200.value.Element.effective_security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrType() - - tag_map = cls._schema_on_200.value.Element.tag_map - tag_map.Element = AAZListType() - - _element = cls._schema_on_200.value.Element.tag_map.Element - _element.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListEffectiveNsgHelper: - """Helper class for ListEffectiveNsg""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["ListEffectiveNsg"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_show.py deleted file mode 100644 index 3f53862a902..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_show.py +++ /dev/null @@ -1,968 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic show", -) -class Show(AAZCommand): - """Get the details of a network interface. - - :example: Get the internal domain name suffix of a NIC. - az network nic show -g MyResourceGroup -n MyNic --query "dnsSettings.internalDomainNameSuffix" - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_show_effective_route_table.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_show_effective_route_table.py deleted file mode 100644 index b2d57b8d7c8..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_show_effective_route_table.py +++ /dev/null @@ -1,211 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic show-effective-route-table", -) -class ShowEffectiveRouteTable(AAZCommand): - """Show the effective route table applied to a network interface. - - To learn more about troubleshooting using the effective route tables visit https://learn.microsoft.com/en-us/azure/virtual-network/diagnose-network-routing-problem#using-effective-routes-to-troubleshoot-vm-traffic-flow. - - :example: Show the effective routes applied to a network interface. - az network nic show-effective-route-table -g MyResourceGroup -n MyNic - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}/effectiveroutetable", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkInterfacesGetEffectiveRouteTable(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkInterfacesGetEffectiveRouteTable(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.address_prefix = AAZListType( - serialized_name="addressPrefix", - ) - _element.name = AAZStrType() - _element.next_hop_ip_address = AAZListType( - serialized_name="nextHopIpAddress", - ) - _element.next_hop_type = AAZStrType( - serialized_name="nextHopType", - ) - _element.source = AAZStrType() - _element.state = AAZStrType() - - address_prefix = cls._schema_on_200.value.Element.address_prefix - address_prefix.Element = AAZStrType() - - next_hop_ip_address = cls._schema_on_200.value.Element.next_hop_ip_address - next_hop_ip_address.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowEffectiveRouteTableHelper: - """Helper class for ShowEffectiveRouteTable""" - - -__all__ = ["ShowEffectiveRouteTable"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_update.py deleted file mode 100644 index e26a2715cc7..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_update.py +++ /dev/null @@ -1,2050 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic update", -) -class Update(AAZCommand): - """Update a network interface. - - :example: Update a network interface to use a different network security group. - az network nic update -g MyResourceGroup -n MyNic --network-security-group MyNewNsg - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.accelerated_networking = AAZBoolArg( - options=["--accelerated-networking"], - help="Whether to enable accelerated networking.", - nullable=True, - ) - _args_schema.ip_forwarding = AAZBoolArg( - options=["--ip-forwarding"], - help="Whether to enable IP forwarding.", - nullable=True, - ) - - # define Arg Group "DNS" - - _args_schema = cls._args_schema - _args_schema.dns_servers = AAZListArg( - options=["--dns-servers"], - arg_group="DNS", - help="Space-separated list of DNS server IP addresses. Use null to revert to default Azure servers.", - nullable=True, - ) - _args_schema.internal_dns_name = AAZStrArg( - options=["--internal-dns-name"], - arg_group="DNS", - help="Name of internal DNS label.", - nullable=True, - ) - - dns_servers = cls._args_schema.dns_servers - dns_servers.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "DnsSettings" - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.nsg = AAZObjectArg( - options=["--nsg"], - arg_group="Properties", - help="The reference to the NetworkSecurityGroup resource.", - nullable=True, - ) - - nsg = cls._args_schema.nsg - nsg.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - nsg.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - nsg.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - nsg.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - nsg.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - nsg.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - nsg.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - nsg.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_schema.nsg.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - security_rules = cls._args_schema.nsg.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.nsg.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - _element.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - _element.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _element.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.", - nullable=True, - ) - _element.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - _element.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _element.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_schema.nsg.security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_schema.nsg.security_rules.Element.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_schema.nsg.security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_schema.nsg.security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_schema.nsg.security_rules.Element.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_schema.nsg.security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - tags = cls._args_schema.nsg.tags - tags.Element = AAZStrArg( - nullable=True, - ) - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg( - nullable=True, - ) - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - network_security_group_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - _element.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - _element.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _element.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - _element.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - _element.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _element.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_network_security_group_update.security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_network_security_group_update.security_rules.Element.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_network_security_group_update.security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_network_security_group_update.security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_network_security_group_update.security_rules.Element.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_network_security_group_update.security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.tags = cls._args_network_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType) - properties.set_prop("enableAcceleratedNetworking", AAZBoolType, ".accelerated_networking") - properties.set_prop("enableIPForwarding", AAZBoolType, ".ip_forwarding") - properties.set_prop("networkSecurityGroup", AAZObjectType, ".nsg") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name") - - dns_servers = _builder.get(".properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - network_security_group = _builder.get(".properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("etag", AAZStrType, ".etag") - network_security_group.set_prop("id", AAZStrType, ".id") - network_security_group.set_prop("location", AAZStrType, ".location") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - network_security_group.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkSecurityGroup.properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - - default_security_rules = _builder.get(".properties.networkSecurityGroup.properties.defaultSecurityRules") - if default_security_rules is not None: - _UpdateHelper._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.networkSecurityGroup.properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkSecurityGroup.properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - _UpdateHelper._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - _UpdateHelper._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.networkSecurityGroup.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.securityRules[].properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.securityRules[].properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.securityRules[].properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.securityRules[].properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.securityRules[].properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.securityRules[].properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_wait.py deleted file mode 100644 index 9fc289e5798..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/_wait.py +++ /dev/null @@ -1,964 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/__cmd_group.py deleted file mode 100644 index cede61b5c80..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 nic ip-config", -) -class __CMDGroup(AAZCommandGroup): - """Manage IP configurations of a network interface. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_create.py deleted file mode 100644 index f197437ac8a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_create.py +++ /dev/null @@ -1,1873 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config create", -) -class Create(AAZCommand): - """Create an IP configuration. - - You must have the Microsoft.Network/AllowMultipleIpConfigurationsPerNic feature enabled for your subscription. Only one configuration may be designated as the primary IP configuration per NIC, using the `--make-primary` flag. - - :example: Create a primary IP configuration for a NIC. - az network nic ip-config create -g MyResourceGroup -n MyIpConfig --nic-name MyNic --make-primary - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01", "properties.ipConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the IP configuration.", - required=True, - ) - - # define Arg Group "IP Configuration" - - _args_schema = cls._args_schema - _args_schema.make_primary = AAZBoolArg( - options=["--make-primary"], - arg_group="IP Configuration", - help="Set to make this configuration the primary one for the NIC.", - default=False, - ) - _args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="IP Configuration", - help="Static IP address to use or \"\"('\"\"' in PowerShell) to use a dynamic address.", - ) - _args_schema.private_ip_address_version = AAZStrArg( - options=["--private-ip-address-version"], - arg_group="IP Configuration", - help="Version of private IP address to use.", - default="IPv4", - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - _args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="IP Configuration", - help="Name or ID of an existing public IP address.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - _args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="IP Configuration", - help="Name or ID of an existing subnet. If name specified, please also specify `--vnet-name`.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}", - ), - ) - - # define Arg Group "Parameters.properties.ipConfigurations[]" - - # define Arg Group "PipObj" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.application_gateway_backend_address_pools = AAZListArg( - options=["--application-gateway-backend-address-pools"], - arg_group="Properties", - help="The reference to ApplicationGatewayBackendAddressPool resource.", - ) - _args_schema.asgs_obj = AAZListArg( - options=["--asgs-obj"], - arg_group="Properties", - help="Application security groups in which the IP configuration is included.", - ) - _args_schema.load_balancer_backend_address_pools = AAZListArg( - options=["--load-balancer-backend-address-pools"], - arg_group="Properties", - help="The reference to LoadBalancerBackendAddressPool resource.", - ) - _args_schema.load_balancer_inbound_nat_rules = AAZListArg( - options=["--load-balancer-inbound-nat-rules"], - arg_group="Properties", - help="A list of references of LoadBalancerInboundNatRules.", - ) - _args_schema.private_ip_allocation_method = AAZStrArg( - options=["--private-ip-allocation-method"], - arg_group="Properties", - help="The private IP address allocation method.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - - application_gateway_backend_address_pools = cls._args_schema.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_schema.application_gateway_backend_address_pools.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the backend address pool that is unique within an Application Gateway.", - ) - - asgs_obj = cls._args_schema.asgs_obj - asgs_obj.Element = AAZObjectArg() - - _element = cls._args_schema.asgs_obj.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_schema.asgs_obj.Element.tags - tags.Element = AAZStrArg() - - load_balancer_backend_address_pools = cls._args_schema.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_schema.load_balancer_backend_address_pools.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resource.", - ) - - load_balancer_inbound_nat_rules = cls._args_schema.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_schema.load_balancer_inbound_nat_rules.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource.", - ) - - # define Arg Group "PublicIPAddress" - - # define Arg Group "Subnet" - - # define Arg Group "SubnetObj" - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg() - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg() - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - network_security_group_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_update(default_security_rules.Element) - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg() - - _element = cls._args_network_security_group_update.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - _element.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - _element.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - _element.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - _element.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - _element.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_network_security_group_update.security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_network_security_group_update.security_rules.Element.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_network_security_group_update.security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_network_security_group_update.security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_network_security_group_update.security_rules.Element.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_network_security_group_update.security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg() - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.tags = cls._args_network_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg() - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg() - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - - _schema.id = cls._args_sub_resource_update.id - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("applicationGatewayBackendAddressPools", AAZListType, ".application_gateway_backend_address_pools") - properties.set_prop("applicationSecurityGroups", AAZListType, ".asgs_obj") - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".make_primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAddressVersion", AAZStrType, ".private_ip_address_version") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType) - properties.set_prop("subnet", AAZObjectType) - - application_gateway_backend_address_pools = _builder.get(".properties.applicationGatewayBackendAddressPools") - if application_gateway_backend_address_pools is not None: - application_gateway_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationGatewayBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - application_security_groups = _builder.get(".properties.applicationSecurityGroups") - if application_security_groups is not None: - application_security_groups.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationSecurityGroups[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".properties.applicationSecurityGroups[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - public_ip_address = _builder.get(".properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".public_ip_address") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - subnet = _builder.get(".properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.securityRules[].properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.securityRules[].properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.securityRules[].properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.securityRules[].properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.securityRules[].properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.securityRules[].properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_delete.py deleted file mode 100644 index ae0b3d6d85e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_delete.py +++ /dev/null @@ -1,1118 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config delete", -) -class Delete(AAZCommand): - """Delete an IP configuration. - - An NIC must have at least one IP configuration. - - :example: Delete an IP configuration. - az network nic ip-config delete -g MyResourceGroup -n MyIpConfig --nic-name MyNic - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01", "properties.ipConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the IP configuration.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_list.py deleted file mode 100644 index 869dccf7b81..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_list.py +++ /dev/null @@ -1,972 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config list", -) -class List(AAZCommand): - """List the IP configurations of an NIC. - - :example: List the IP configurations of an NIC. - az network nic ip-config list -g MyResourceGroup --nic-name MyNic - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01", "properties.ipConfigurations"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.ipConfigurations - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.ipConfigurations = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_show.py deleted file mode 100644 index 0eb5404d15c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_show.py +++ /dev/null @@ -1,991 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config show", -) -class Show(AAZCommand): - """Show the details of an IP configuration. - - :example: Show the details of an IP configuration of an NIC. - az network nic ip-config show -g MyResourceGroup -n MyIpConfig --nic-name MyNic - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01", "properties.ipConfigurations[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the IP configuration.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_update.py deleted file mode 100644 index 6a531e1ab6c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_update.py +++ /dev/null @@ -1,1996 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config update", -) -class Update(AAZCommand): - """Update an IP configuration. - - :example: Update a NIC to use a new private IP address. - az network nic ip-config update -g MyResourceGroup --nic-name MyNic -n MyIpConfig --private-ip-address 10.0.0.9 - - :example: Make an IP configuration the default for the supplied NIC. - az network nic ip-config update -g MyResourceGroup --nic-name MyNic -n MyIpConfig --make-primary - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01", "properties.ipConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the IP configuration.", - required=True, - ) - - # define Arg Group "IP Configuration" - - _args_schema = cls._args_schema - _args_schema.make_primary = AAZBoolArg( - options=["--make-primary"], - arg_group="IP Configuration", - help="Set to make this configuration the primary one for the NIC.", - nullable=True, - ) - _args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="IP Configuration", - help="Static IP address to use or \"\"('\"\"' in PowerShell) to use a dynamic address.", - nullable=True, - ) - _args_schema.private_ip_address_version = AAZStrArg( - options=["--private-ip-address-version"], - arg_group="IP Configuration", - help="Version of private IP address to use.", - nullable=True, - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - _args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="IP Configuration", - help="Name or ID of an existing public IP address.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - _args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="IP Configuration", - help="Name or ID of an existing subnet. If name specified, please also specify `--vnet-name`.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}", - ), - ) - - # define Arg Group "Parameters.properties.ipConfigurations[]" - - # define Arg Group "PipObj" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.application_gateway_backend_address_pools = AAZListArg( - options=["--application-gateway-backend-address-pools"], - arg_group="Properties", - help="The reference to ApplicationGatewayBackendAddressPool resource.", - nullable=True, - ) - _args_schema.asgs_obj = AAZListArg( - options=["--asgs-obj"], - arg_group="Properties", - help="Application security groups in which the IP configuration is included.", - nullable=True, - ) - _args_schema.load_balancer_backend_address_pools = AAZListArg( - options=["--load-balancer-backend-address-pools"], - arg_group="Properties", - help="The reference to LoadBalancerBackendAddressPool resource.", - nullable=True, - ) - _args_schema.load_balancer_inbound_nat_rules = AAZListArg( - options=["--load-balancer-inbound-nat-rules"], - arg_group="Properties", - help="A list of references of LoadBalancerInboundNatRules.", - nullable=True, - ) - _args_schema.private_ip_allocation_method = AAZStrArg( - options=["--private-ip-allocation-method"], - arg_group="Properties", - help="The private IP address allocation method.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - - application_gateway_backend_address_pools = cls._args_schema.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.application_gateway_backend_address_pools.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the backend address pool that is unique within an Application Gateway.", - nullable=True, - ) - - asgs_obj = cls._args_schema.asgs_obj - asgs_obj.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.asgs_obj.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_schema.asgs_obj.Element.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - load_balancer_backend_address_pools = cls._args_schema.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.load_balancer_backend_address_pools.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resource.", - nullable=True, - ) - - load_balancer_inbound_nat_rules = cls._args_schema.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.load_balancer_inbound_nat_rules.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource.", - nullable=True, - ) - - # define Arg Group "PublicIPAddress" - - # define Arg Group "Subnet" - - # define Arg Group "SubnetObj" - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg( - nullable=True, - ) - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - network_security_group_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - _element.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - _element.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - _element.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - _element.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - _element.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - _element.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_network_security_group_update.security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_network_security_group_update.security_rules.Element.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_network_security_group_update.security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_network_security_group_update.security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_network_security_group_update.security_rules.Element.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_network_security_group_update.security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.tags = cls._args_network_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("applicationGatewayBackendAddressPools", AAZListType, ".application_gateway_backend_address_pools") - properties.set_prop("applicationSecurityGroups", AAZListType, ".asgs_obj") - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".make_primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAddressVersion", AAZStrType, ".private_ip_address_version") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType) - properties.set_prop("subnet", AAZObjectType) - - application_gateway_backend_address_pools = _builder.get(".properties.applicationGatewayBackendAddressPools") - if application_gateway_backend_address_pools is not None: - application_gateway_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationGatewayBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - application_security_groups = _builder.get(".properties.applicationSecurityGroups") - if application_security_groups is not None: - application_security_groups.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationSecurityGroups[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".properties.applicationSecurityGroups[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - public_ip_address = _builder.get(".properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".public_ip_address") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - subnet = _builder.get(".properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.securityRules[].properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.securityRules[].properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.securityRules[].properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.securityRules[].properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.securityRules[].properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.securityRules[].properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_wait.py deleted file mode 100644 index bfca6e15c96..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/_wait.py +++ /dev/null @@ -1,957 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01", "properties.ipConfigurations[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/ag_pool/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/ag_pool/__cmd_group.py deleted file mode 100644 index 265bf5a2e1b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/ag_pool/__cmd_group.py +++ /dev/null @@ -1,20 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class __CMDGroup(AAZCommandGroup): - """Manage address pools in an IP configuration. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/ag_pool/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/ag_pool/__init__.py deleted file mode 100644 index 0b07bb6fd96..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/ag_pool/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._add import * -from ._remove import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/ag_pool/_add.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/ag_pool/_add.py deleted file mode 100644 index 228d520fb9f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/ag_pool/_add.py +++ /dev/null @@ -1,1147 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Add(AAZCommand): - """Add an address pool to an IP configuration. - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01", "properties.ipConfigurations[].properties.applicationGatewayBackendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.pool_id = AAZStrArg( - options=["--pool-id"], - help="Resource ID.", - required=True, - ) - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.applicationGatewayBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.applicationGatewayBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("id", AAZStrType, ".pool_id") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - -class _AddHelper: - """Helper class for Add""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Add"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/ag_pool/_remove.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/ag_pool/_remove.py deleted file mode 100644 index aa128b06349..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/ag_pool/_remove.py +++ /dev/null @@ -1,1131 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Remove(AAZCommand): - """Remove an address pool of an IP configuration. - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01", "properties.ipConfigurations[].properties.applicationGatewayBackendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.pool_id = AAZStrArg( - options=["--pool-id"], - help="Resource ID.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.applicationGatewayBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.applicationGatewayBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _RemoveHelper: - """Helper class for Remove""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Remove"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/inbound_nat_rule/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/inbound_nat_rule/__cmd_group.py deleted file mode 100644 index 0ad92b74449..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/inbound_nat_rule/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 nic ip-config inbound-nat-rule", -) -class __CMDGroup(AAZCommandGroup): - """Manage inbound NAT rules of an IP configuration. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/inbound_nat_rule/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/inbound_nat_rule/__init__.py deleted file mode 100644 index 7767ee77098..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/inbound_nat_rule/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._add import * -from ._remove import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/inbound_nat_rule/_add.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/inbound_nat_rule/_add.py deleted file mode 100644 index f349a42834e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/inbound_nat_rule/_add.py +++ /dev/null @@ -1,1182 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config inbound-nat-rule add", -) -class Add(AAZCommand): - """Add an inbound NAT rule to an IP configuration. - - :example: Add an inbound NAT rule to an IP configuration. - az network nic ip-config inbound-nat-rule add -g MyResourceGroup --nic-name MyNic -n MyIpConfig --inbound-nat-rule MyNatRule - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01", "properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.inbound_nat_rule = AAZResourceIdArg( - options=["--inbound-nat-rule"], - help="Name or ID of an existing inbound NAT rule. If name is used, `--lb-name` must be specified.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - - # define Arg Group "Parameters.properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]" - - # define Arg Group "Properties" - return cls._args_schema - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg() - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - - _schema.id = cls._args_sub_resource_update.id - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerInboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.inbound_nat_rule, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerInboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.inbound_nat_rule, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("id", AAZStrType, ".inbound_nat_rule") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - -class _AddHelper: - """Helper class for Add""" - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Add"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/inbound_nat_rule/_remove.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/inbound_nat_rule/_remove.py deleted file mode 100644 index c29aacb0081..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/inbound_nat_rule/_remove.py +++ /dev/null @@ -1,1140 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config inbound-nat-rule remove", -) -class Remove(AAZCommand): - """Remove an inbound NAT rule of an IP configuration. - - :example: Remove an inbound NAT rule of an IP configuration. - az network nic ip-config inbound-nat-rule remove -g MyResourceGroup --nic-name MyNic -n MyIpConfig --inbound-nat-rule MyNatRule - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01", "properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.inbound_nat_rule = AAZResourceIdArg( - options=["--inbound-nat-rule"], - help="Resource ID.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerInboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.inbound_nat_rule, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerInboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.inbound_nat_rule, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _RemoveHelper: - """Helper class for Remove""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Remove"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/inbound_nat_rule/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/inbound_nat_rule/_wait.py deleted file mode 100644 index d7988218249..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/inbound_nat_rule/_wait.py +++ /dev/null @@ -1,957 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config inbound-nat-rule wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01", "properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/lb_pool/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/lb_pool/__cmd_group.py deleted file mode 100644 index 265bf5a2e1b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/lb_pool/__cmd_group.py +++ /dev/null @@ -1,20 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class __CMDGroup(AAZCommandGroup): - """Manage address pools in an IP configuration. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/lb_pool/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/lb_pool/__init__.py deleted file mode 100644 index 0b07bb6fd96..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/lb_pool/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._add import * -from ._remove import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/lb_pool/_add.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/lb_pool/_add.py deleted file mode 100644 index 0e531d656cd..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/lb_pool/_add.py +++ /dev/null @@ -1,1152 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Add(AAZCommand): - """Add an address pool to an IP configuration. - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01", "properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.pool_id = AAZResourceIdArg( - options=["--pool-id"], - help="Resource ID.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}", - ), - ) - - # define Arg Group "Parameters.properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]" - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("id", AAZStrType, ".pool_id") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - -class _AddHelper: - """Helper class for Add""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Add"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/lb_pool/_remove.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/lb_pool/_remove.py deleted file mode 100644 index 20269608205..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nic/ip_config/lb_pool/_remove.py +++ /dev/null @@ -1,1134 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Remove(AAZCommand): - """Remove an address pool of an IP configuration. - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2017-10-01", "properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.pool_id = AAZResourceIdArg( - options=["--pool-id"], - help="Resource ID.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}", - ), - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _RemoveHelper: - """Helper class for Remove""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Remove"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/__cmd_group.py deleted file mode 100644 index 581b4fd303c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 nsg", -) -class __CMDGroup(AAZCommandGroup): - """Manage Azure Network Security Groups (NSGs). - - You can control network traffic to resources in a virtual network using a network security group. A network security group contains a list of security rules that allow or deny inbound or outbound network traffic based on source or destination IP addresses, Application Security Groups, ports, and protocols. For more information visit https://learn.microsoft.com/azure/virtual-network/virtual-networks-create-nsg-arm-cli. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_create.py deleted file mode 100644 index 66f81238b45..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_create.py +++ /dev/null @@ -1,1233 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg create", -) -class Create(AAZCommand): - """Create a network security group. - - :example: Create an NSG in a resource group within a region with tags. - az network nsg create -g MyResourceGroup -n MyNsg --tags foo=bar - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - return cls._args_schema - - _args_application_security_group_create = None - - @classmethod - def _build_args_application_security_group_create(cls, _schema): - if cls._args_application_security_group_create is not None: - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - return - - cls._args_application_security_group_create = AAZObjectArg() - - application_security_group_create = cls._args_application_security_group_create - application_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - security_rule_create.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - security_rule_create.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_create.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkSecurityGroupsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkSecurityGroupsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_network_security_group_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_application_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_delete.py deleted file mode 100644 index b345ccf5271..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg delete", -) -class Delete(AAZCommand): - """Delete a network security group. - - :example: Delete an NSG in a resource group. - az network nsg delete -g MyResourceGroup -n MyNsg - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkSecurityGroupsDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class NetworkSecurityGroupsDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_list.py deleted file mode 100644 index 8b6a4b24ed0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_list.py +++ /dev/null @@ -1,1022 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg list", -) -class List(AAZCommand): - """List network security groups. - - :example: List all NSGs in the 'westus' region. - az network nsg list --query "[?location=='westus']" - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/networksecuritygroups", "2017-10-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - if condition_0: - self.NetworkSecurityGroupsListAll(ctx=self.ctx)() - if condition_1: - self.NetworkSecurityGroupsList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class NetworkSecurityGroupsListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_network_security_group_read(value.Element) - - return cls._schema_on_200 - - class NetworkSecurityGroupsList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_network_security_group_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_show.py deleted file mode 100644 index 98e659d3f58..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_show.py +++ /dev/null @@ -1,948 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg show", -) -class Show(AAZCommand): - """Get information about a network security group. - - :example: Get basic information about an NSG. - az network nsg show -g MyResourceGroup -n MyNsg - - :example: Get the default security rules of an NSG and format the output as a table. - az network nsg show -g MyResourceGroup -n MyNsg --query "defaultSecurityRules[]" -o table - - :example: Get all default NSG rules with "Allow" access and format the output as a table. - az network nsg show -g MyResourceGroup -n MyNsg --query "defaultSecurityRules[?access=='Allow']" -o table - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkSecurityGroupsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkSecurityGroupsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_network_security_group_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_update.py deleted file mode 100644 index 310cb7dd59c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_update.py +++ /dev/null @@ -1,1390 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg update", -) -class Update(AAZCommand): - """Update a network security group. - - This command can only be used to update the tags of an NSG. Name and resource group are immutable and cannot be updated. - - :example: Remove a tag of an NSG. - az network nsg update -g MyResourceGroup -n MyNsg --remove tags.no_80 - - :example: Update a network security group. (autogenerated) - az network nsg update --name MyNsg --resource-group MyResourceGroup --set tags.CostCenter=MyBusinessGroup - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - def _execute_operations(self): - self.pre_operations() - self.NetworkSecurityGroupsGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.NetworkSecurityGroupsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkSecurityGroupsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_network_security_group_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkSecurityGroupsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_network_security_group_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_wait.py deleted file mode 100644 index 46f52b3f907..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/_wait.py +++ /dev/null @@ -1,938 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkSecurityGroupsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class NetworkSecurityGroupsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_network_security_group_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/__cmd_group.py deleted file mode 100644 index cf73713d97d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 nsg rule", -) -class __CMDGroup(AAZCommandGroup): - """Manage network security group rules. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_create.py deleted file mode 100644 index 8a14f92036e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_create.py +++ /dev/null @@ -1,544 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule create", -) -class Create(AAZCommand): - """Create a network security group rule. - - :example: Create a basic "Allow" NSG rule with the highest priority. - az network nsg rule create -g MyResourceGroup --nsg-name MyNsg -n MyNsgRule --priority 100 - - :example: Create a "Deny" rule over TCP for a specific IP address range with the lowest priority. - az network nsg rule create -g MyResourceGroup --nsg-name MyNsg -n MyNsgRule --priority 4096 --source-address-prefixes 208.130.28.0/24 --source-port-ranges 80 --destination-address-prefixes '*' --destination-port-ranges 80 8080 --access Deny --protocol Tcp --description "Deny from specific IP address ranges on 80 and 8080." - - :example: Create a security rule using service tags (https://aka.ms/servicetags). - az network nsg rule create -g MyResourceGroup --nsg-name MyNsg -n MyNsgRuleWithTags --priority 400 --source-address-prefixes VirtualNetwork --destination-address-prefixes Storage --destination-port-ranges '*' --direction Outbound --access Allow --protocol Tcp --description "Allow VirtualNetwork to Storage." - - :example: Create a security rule using application security groups (https://aka.ms/applicationsecuritygroups). - az network nsg rule create -g MyResourceGroup --nsg-name MyNsg -n MyNsgRuleWithAsg --priority 500 --source-address-prefixes Internet --destination-port-ranges 80 8080 --destination-asgs Web --access Allow --protocol Tcp --description "Allow Internet to Web ASG on ports 80,8080." - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group rule.", - required=True, - ) - _args_schema.access = AAZStrArg( - options=["--access"], - help="Network traffic is allowed or denied.", - default="Allow", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _args_schema.description = AAZStrArg( - options=["--description"], - help="Description for this rule. Restricted to 140 chars.", - ) - _args_schema.direction = AAZStrArg( - options=["--direction"], - help="Direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", - default="Inbound", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _args_schema.priority = AAZIntArg( - options=["--priority"], - help="Priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - help="Network protocol this rule applies to.", - default="*", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - # define Arg Group "Destination" - - _args_schema = cls._args_schema - _args_schema.destination_address_prefix = AAZStrArg( - options=["--destination-address-prefix"], - arg_group="Destination", - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _args_schema.destination_address_prefixes = AAZListArg( - options=["--destination-address-prefixes"], - arg_group="Destination", - help="Space-separated list of CIDR prefixes or IP ranges. Alternatively, specify ONE of 'VirtualNetwork', 'AzureLoadBalancer', 'Internet' or '*' to match all IPs. Besides, it also supports all available Service Tags like 'ApiManagement', 'SqlManagement', 'AzureMonitor', etc.", - default=["*"], - ) - _args_schema.destination_application_security_groups = AAZListArg( - options=["--destination-application-security-groups"], - arg_group="Destination", - help="Application security group specified as destination.", - ) - _args_schema.destination_port_range = AAZStrArg( - options=["--destination-port-range"], - arg_group="Destination", - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _args_schema.destination_port_ranges = AAZListArg( - options=["--destination-port-ranges"], - arg_group="Destination", - help="Space-separated list of ports or port ranges between 0-65535. Use '*' to match all ports.", - default=["80"], - ) - - destination_address_prefixes = cls._args_schema.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_schema.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_schema.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - # define Arg Group "Properties" - - # define Arg Group "SecurityRuleParameters" - - # define Arg Group "Source" - - _args_schema = cls._args_schema - _args_schema.source_address_prefix = AAZStrArg( - options=["--source-address-prefix"], - arg_group="Source", - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.", - ) - _args_schema.source_address_prefixes = AAZListArg( - options=["--source-address-prefixes"], - arg_group="Source", - help="Space-separated list of CIDR prefixes or IP ranges. Alternatively, specify ONE of 'VirtualNetwork', 'AzureLoadBalancer', 'Internet' or '*' to match all IPs. Besides, it also supports all available Service Tags like 'ApiManagement', 'SqlManagement', 'AzureMonitor', etc.", - default=["*"], - ) - _args_schema.source_application_security_groups = AAZListArg( - options=["--source-application-security-groups"], - arg_group="Source", - help="Application security group specified as source.", - ) - _args_schema.source_port_range = AAZStrArg( - options=["--source-port-range"], - arg_group="Source", - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _args_schema.source_port_ranges = AAZListArg( - options=["--source-port-ranges"], - arg_group="Source", - help="Space-separated list of ports or port ranges between 0-65535. Use '*' to match all ports.", - default=["*"], - ) - - source_address_prefixes = cls._args_schema.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_schema.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_schema.source_port_ranges - source_port_ranges.Element = AAZStrArg() - return cls._args_schema - - _args_application_security_group_create = None - - @classmethod - def _build_args_application_security_group_create(cls, _schema): - if cls._args_application_security_group_create is not None: - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - return - - cls._args_application_security_group_create = AAZObjectArg() - - application_security_group_create = cls._args_application_security_group_create - application_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - - def _execute_operations(self): - self.pre_operations() - yield self.SecurityRulesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SecurityRulesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - _CreateHelper._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - _CreateHelper._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.name = AAZStrType() - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = cls._schema_on_200_201.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = cls._schema_on_200_201.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - _CreateHelper._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = cls._schema_on_200_201.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = cls._schema_on_200_201.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = cls._schema_on_200_201.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - _CreateHelper._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = cls._schema_on_200_201.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_application_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_delete.py deleted file mode 100644 index 50b3c11beaa..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_delete.py +++ /dev/null @@ -1,172 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule delete", -) -class Delete(AAZCommand): - """Delete a network security group rule. - - :example: Delete a network security group rule. - az network nsg rule delete -g MyResourceGroup --nsg-name MyNsg -n MyNsgRule - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group rule.", - required=True, - id_part="child_name_1", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.SecurityRulesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class SecurityRulesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_list.py deleted file mode 100644 index ffbdcf0e67b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_list.py +++ /dev/null @@ -1,298 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule list", -) -class List(AAZCommand): - """List all rules in a network security group. - - :example: List all rules in a network security group. - az network nsg rule list -g MyResourceGroup --nsg-name MyNsg - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SecurityRulesList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class SecurityRulesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = cls._schema_on_200.value.Element.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = cls._schema_on_200.value.Element.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - _ListHelper._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = cls._schema_on_200.value.Element.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = cls._schema_on_200.value.Element.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = cls._schema_on_200.value.Element.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - _ListHelper._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = cls._schema_on_200.value.Element.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_show.py deleted file mode 100644 index 7862b34827d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_show.py +++ /dev/null @@ -1,300 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule show", -) -class Show(AAZCommand): - """Get the details of a network security group rule. - - :example: Get the details of a network security group rule. - az network nsg rule show -g MyResourceGroup --nsg-name MyNsg -n MyNsgRule - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group rule.", - required=True, - id_part="child_name_1", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SecurityRulesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SecurityRulesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = cls._schema_on_200.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = cls._schema_on_200.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - _ShowHelper._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = cls._schema_on_200.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = cls._schema_on_200.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = cls._schema_on_200.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - _ShowHelper._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = cls._schema_on_200.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_update.py deleted file mode 100644 index 223e6473df2..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_update.py +++ /dev/null @@ -1,706 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule update", -) -class Update(AAZCommand): - """Update a network security group rule. - - :example: Update an NSG rule with a new wildcard destination address prefix. - az network nsg rule update -g MyResourceGroup --nsg-name MyNsg -n MyNsgRule --destination-address-prefix '*' - - :example: Update a network security group rule. - az network nsg rule update --name MyNsgRule --nsg-name MyNsg --resource-group MyResourceGroup --source-address-prefixes 208.130.28/24 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group rule.", - required=True, - id_part="child_name_1", - ) - _args_schema.access = AAZStrArg( - options=["--access"], - help="Network traffic is allowed or denied.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _args_schema.description = AAZStrArg( - options=["--description"], - help="Description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _args_schema.direction = AAZStrArg( - options=["--direction"], - help="Direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _args_schema.priority = AAZIntArg( - options=["--priority"], - help="Priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - help="Network protocol this rule applies to.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - # define Arg Group "Destination" - - _args_schema = cls._args_schema - _args_schema.destination_address_prefix = AAZStrArg( - options=["--destination-address-prefix"], - arg_group="Destination", - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - _args_schema.destination_address_prefixes = AAZListArg( - options=["--destination-address-prefixes"], - arg_group="Destination", - help="Space-separated list of CIDR prefixes or IP ranges. Alternatively, specify ONE of 'VirtualNetwork', 'AzureLoadBalancer', 'Internet' or '*' to match all IPs. Besides, it also supports all available Service Tags like 'ApiManagement', 'SqlManagement', 'AzureMonitor', etc.", - nullable=True, - ) - _args_schema.destination_application_security_groups = AAZListArg( - options=["--destination-application-security-groups"], - arg_group="Destination", - help="Application security group specified as destination.", - nullable=True, - ) - _args_schema.destination_port_range = AAZStrArg( - options=["--destination-port-range"], - arg_group="Destination", - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _args_schema.destination_port_ranges = AAZListArg( - options=["--destination-port-ranges"], - arg_group="Destination", - help="Space-separated list of ports or port ranges between 0-65535. Use '*' to match all ports.", - nullable=True, - ) - - destination_address_prefixes = cls._args_schema.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_schema.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_schema.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Properties" - - # define Arg Group "SecurityRuleParameters" - - # define Arg Group "Source" - - _args_schema = cls._args_schema - _args_schema.source_address_prefix = AAZStrArg( - options=["--source-address-prefix"], - arg_group="Source", - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.", - nullable=True, - ) - _args_schema.source_address_prefixes = AAZListArg( - options=["--source-address-prefixes"], - arg_group="Source", - help="Space-separated list of CIDR prefixes or IP ranges. Alternatively, specify ONE of 'VirtualNetwork', 'AzureLoadBalancer', 'Internet' or '*' to match all IPs. Besides, it also supports all available Service Tags like 'ApiManagement', 'SqlManagement', 'AzureMonitor', etc.", - nullable=True, - ) - _args_schema.source_application_security_groups = AAZListArg( - options=["--source-application-security-groups"], - arg_group="Source", - help="Application security group specified as source.", - nullable=True, - ) - _args_schema.source_port_range = AAZStrArg( - options=["--source-port-range"], - arg_group="Source", - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _args_schema.source_port_ranges = AAZListArg( - options=["--source-port-ranges"], - arg_group="Source", - help="Space-separated list of ports or port ranges between 0-65535. Use '*' to match all ports.", - nullable=True, - ) - - source_address_prefixes = cls._args_schema.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_schema.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_schema.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - def _execute_operations(self): - self.pre_operations() - self.SecurityRulesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.SecurityRulesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SecurityRulesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_security_rule_read(cls._schema_on_200) - - return cls._schema_on_200 - - class SecurityRulesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_security_rule_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - _UpdateHelper._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - _UpdateHelper._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_wait.py deleted file mode 100644 index 634e5f4e2f1..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/nsg/rule/_wait.py +++ /dev/null @@ -1,296 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group rule.", - required=True, - id_part="child_name_1", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SecurityRulesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class SecurityRulesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = cls._schema_on_200.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = cls._schema_on_200.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - _WaitHelper._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = cls._schema_on_200.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = cls._schema_on_200.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = cls._schema_on_200.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - _WaitHelper._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = cls._schema_on_200.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/__cmd_group.py deleted file mode 100644 index 07c867f7590..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 public-ip", -) -class __CMDGroup(AAZCommandGroup): - """Manage public IP addresses. - - To learn more about public IP addresses visit https://learn.microsoft.com/azure/virtual-network/virtual-network-public-ip-address. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_create.py deleted file mode 100644 index 9a3f8b8e139..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_create.py +++ /dev/null @@ -1,1312 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip create", -) -class Create(AAZCommand): - """Create a public IP address. - - :example: Create a basic public IP resource. - az network public-ip create -g MyResourceGroup -n MyIp - - :example: Create a static public IP resource for a DNS name label. - az network public-ip create -g MyResourceGroup -n MyIp --dns-name MyLabel --allocation-method Static - - :example: Create a public IP resource in an availability zone in the current resource group region. - az network public-ip create -g MyResourceGroup -n MyIp --zone 2 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP address.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.dns_name = AAZStrArg( - options=["--dns-name"], - help="Globally unique DNS entry.", - ) - _args_schema.reverse_fqdn = AAZStrArg( - options=["--reverse-fqdn"], - help="Reverse FQDN (fully qualified domain name).", - ) - _args_schema.idle_timeout = AAZIntArg( - options=["--idle-timeout"], - help="Idle timeout in minutes.", - default=4, - ) - _args_schema.ip_address = AAZStrArg( - options=["--ip-address"], - help="The IP address associated with the public IP address resource.", - ) - _args_schema.version = AAZStrArg( - options=["--version"], - help="IP address type.", - default="IPv4", - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - _args_schema.allocation_method = AAZStrArg( - options=["--allocation-method"], - help="IP address allocation method. Allowed values: Dynamic, Static.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _args_schema.sku = AAZStrArg( - options=["--sku"], - help="Name of a public IP address SKU.", - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - _args_schema.zone = AAZListArg( - options=["-z", "--zone"], - help="Availability zone into which to provision the resource. Allowed values: 1, 2, 3.", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - zone = cls._args_schema.zone - zone.Element = AAZStrArg() - - # define Arg Group "DnsSettings" - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.PublicIPAddressesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class PublicIPAddressesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("sku", AAZObjectType) - _builder.set_prop("tags", AAZDictType, ".tags") - _builder.set_prop("zones", AAZListType, ".zone") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("publicIPAddressVersion", AAZStrType, ".version") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".allocation_method") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".dns_name") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - sku = _builder.get(".sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".sku") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - zones = _builder.get(".zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_public_ip_address_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType( - flags={"read_only": True} - ) - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.location = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - application_security_group_read.tags = AAZDictType( - flags={"read_only": True}, - ) - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - flags={"read_only": True}, - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - flags={"read_only": True}, - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - flags={"read_only": True}, - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - flags={"read_only": True}, - ) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - flags={"read_only": True}, - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType( - flags={"read_only": True}, - ) - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - flags={"read_only": True}, - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"read_only": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - flags={"read_only": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"read_only": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType( - flags={"read_only": True} - ) - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.location = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - network_security_group_read.tags = AAZDictType( - flags={"read_only": True}, - ) - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - flags={"read_only": True}, - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.location = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - _element.tags = AAZDictType( - flags={"read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - flags={"read_only": True}, - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - flags={"read_only": True}, - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - flags={"read_only": True}, - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - flags={"read_only": True}, - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - flags={"read_only": True}, - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - flags={"read_only": True}, - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - flags={"read_only": True}, - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType( - flags={"read_only": True} - ) - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.id = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.name = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.description = AAZStrType( - flags={"read_only": True}, - ) - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"read_only": True}, - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - flags={"read_only": True}, - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - flags={"read_only": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - flags={"read_only": True}, - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - flags={"read_only": True}, - ) - properties.direction = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.priority = AAZIntType( - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"read_only": True}, - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - flags={"read_only": True}, - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - flags={"read_only": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - flags={"read_only": True}, - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - flags={"read_only": True}, - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType( - flags={"read_only": True}, - ) - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType( - flags={"read_only": True}, - ) - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType( - flags={"read_only": True}, - ) - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType( - flags={"read_only": True} - ) - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType( - flags={"read_only": True}, - ) - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType( - flags={"read_only": True} - ) - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.id = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.name = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - flags={"read_only": True}, - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - flags={"read_only": True}, - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - flags={"read_only": True}, - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType( - flags={"read_only": True}, - ) - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType( - flags={"read_only": True}, - ) - route_table.id = AAZStrType( - flags={"read_only": True}, - ) - route_table.location = AAZStrType( - flags={"read_only": True}, - ) - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - route_table.tags = AAZDictType( - flags={"read_only": True}, - ) - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.routes = AAZListType( - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - flags={"read_only": True}, - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType( - flags={"read_only": True}, - ) - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - _element.service = AAZStrType( - flags={"read_only": True}, - ) - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_delete.py deleted file mode 100644 index 1ec28ac2a7b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip delete", -) -class Delete(AAZCommand): - """Delete a public IP address. - - :example: Delete a public IP address. - az network public-ip delete -g MyResourceGroup -n MyIp - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP address.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.PublicIPAddressesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class PublicIPAddressesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_list.py deleted file mode 100644 index de06cef9788..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_list.py +++ /dev/null @@ -1,1281 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip list", -) -class List(AAZCommand): - """List public IP addresses. - - :example: List all public IPs in a subscription. - az network public-ip list - - :example: List all public IPs in a resource group. - az network public-ip list -g MyResourceGroup - - :example: List all public IPs of a domain name label. - az network public-ip list -g MyResourceGroup --query "[?dnsSettings.domainNameLabel=='MyLabel']" - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/publicipaddresses", "2017-10-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.PublicIPAddressesList(ctx=self.ctx)() - if condition_1: - self.PublicIPAddressesListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class PublicIPAddressesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_public_ip_address_read(value.Element) - - return cls._schema_on_200 - - class PublicIPAddressesListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_public_ip_address_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType( - flags={"read_only": True} - ) - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.location = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - application_security_group_read.tags = AAZDictType( - flags={"read_only": True}, - ) - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - flags={"read_only": True}, - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - flags={"read_only": True}, - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - flags={"read_only": True}, - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - flags={"read_only": True}, - ) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - flags={"read_only": True}, - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType( - flags={"read_only": True}, - ) - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - flags={"read_only": True}, - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"read_only": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - flags={"read_only": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"read_only": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType( - flags={"read_only": True} - ) - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.location = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - network_security_group_read.tags = AAZDictType( - flags={"read_only": True}, - ) - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - flags={"read_only": True}, - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.location = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - _element.tags = AAZDictType( - flags={"read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - flags={"read_only": True}, - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - flags={"read_only": True}, - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - flags={"read_only": True}, - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - flags={"read_only": True}, - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - flags={"read_only": True}, - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - flags={"read_only": True}, - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - flags={"read_only": True}, - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType( - flags={"read_only": True} - ) - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.id = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.name = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.description = AAZStrType( - flags={"read_only": True}, - ) - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"read_only": True}, - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - flags={"read_only": True}, - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - flags={"read_only": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - flags={"read_only": True}, - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - flags={"read_only": True}, - ) - properties.direction = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.priority = AAZIntType( - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"read_only": True}, - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - flags={"read_only": True}, - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - flags={"read_only": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - flags={"read_only": True}, - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - flags={"read_only": True}, - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType( - flags={"read_only": True}, - ) - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType( - flags={"read_only": True}, - ) - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType( - flags={"read_only": True}, - ) - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType( - flags={"read_only": True} - ) - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType( - flags={"read_only": True}, - ) - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType( - flags={"read_only": True} - ) - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.id = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.name = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - flags={"read_only": True}, - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - flags={"read_only": True}, - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - flags={"read_only": True}, - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType( - flags={"read_only": True}, - ) - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType( - flags={"read_only": True}, - ) - route_table.id = AAZStrType( - flags={"read_only": True}, - ) - route_table.location = AAZStrType( - flags={"read_only": True}, - ) - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - route_table.tags = AAZDictType( - flags={"read_only": True}, - ) - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.routes = AAZListType( - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - flags={"read_only": True}, - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType( - flags={"read_only": True}, - ) - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - _element.service = AAZStrType( - flags={"read_only": True}, - ) - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_show.py deleted file mode 100644 index f72559aa688..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_show.py +++ /dev/null @@ -1,1198 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip show", -) -class Show(AAZCommand): - """Get the details of a public IP address. - - :example: Get information about a public IP resource. - az network public-ip show -g MyResourceGroup -n MyIp - - :example: Get the FQDN and IP address of a public IP resource. - az network public-ip show -g MyResourceGroup -n MyIp --query "{fqdn: dnsSettings.fqdn,address: ipAddress}" - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP address.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PublicIPAddressesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class PublicIPAddressesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_public_ip_address_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType( - flags={"read_only": True} - ) - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.location = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - application_security_group_read.tags = AAZDictType( - flags={"read_only": True}, - ) - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - flags={"read_only": True}, - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - flags={"read_only": True}, - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - flags={"read_only": True}, - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - flags={"read_only": True}, - ) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - flags={"read_only": True}, - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType( - flags={"read_only": True}, - ) - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - flags={"read_only": True}, - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"read_only": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - flags={"read_only": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"read_only": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType( - flags={"read_only": True} - ) - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.location = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - network_security_group_read.tags = AAZDictType( - flags={"read_only": True}, - ) - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - flags={"read_only": True}, - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.location = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - _element.tags = AAZDictType( - flags={"read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - flags={"read_only": True}, - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - flags={"read_only": True}, - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - flags={"read_only": True}, - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - flags={"read_only": True}, - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - flags={"read_only": True}, - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - flags={"read_only": True}, - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - flags={"read_only": True}, - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType( - flags={"read_only": True} - ) - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.id = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.name = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.description = AAZStrType( - flags={"read_only": True}, - ) - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"read_only": True}, - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - flags={"read_only": True}, - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - flags={"read_only": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - flags={"read_only": True}, - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - flags={"read_only": True}, - ) - properties.direction = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.priority = AAZIntType( - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"read_only": True}, - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - flags={"read_only": True}, - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - flags={"read_only": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - flags={"read_only": True}, - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - flags={"read_only": True}, - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType( - flags={"read_only": True}, - ) - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType( - flags={"read_only": True}, - ) - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType( - flags={"read_only": True}, - ) - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType( - flags={"read_only": True} - ) - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType( - flags={"read_only": True}, - ) - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType( - flags={"read_only": True} - ) - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.id = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.name = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - flags={"read_only": True}, - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - flags={"read_only": True}, - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - flags={"read_only": True}, - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType( - flags={"read_only": True}, - ) - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType( - flags={"read_only": True}, - ) - route_table.id = AAZStrType( - flags={"read_only": True}, - ) - route_table.location = AAZStrType( - flags={"read_only": True}, - ) - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - route_table.tags = AAZDictType( - flags={"read_only": True}, - ) - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.routes = AAZListType( - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - flags={"read_only": True}, - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType( - flags={"read_only": True}, - ) - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - _element.service = AAZStrType( - flags={"read_only": True}, - ) - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_update.py deleted file mode 100644 index 85cb110312c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_update.py +++ /dev/null @@ -1,1410 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip update", -) -class Update(AAZCommand): - """Update a public IP address. - - :example: Update a public IP resource with a DNS name label and static allocation. - az network public-ip update -g MyResourceGroup -n MyIp --dns-name MyLabel --allocation-method Static - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP address.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.dns_name = AAZStrArg( - options=["--dns-name"], - help="Globally unique DNS entry.", - nullable=True, - ) - _args_schema.reverse_fqdn = AAZStrArg( - options=["--reverse-fqdn"], - help="Reverse FQDN (fully qualified domain name).", - nullable=True, - ) - _args_schema.idle_timeout = AAZIntArg( - options=["--idle-timeout"], - help="Idle timeout in minutes.", - nullable=True, - ) - _args_schema.version = AAZStrArg( - options=["--version"], - help="IP address type.", - default="IPv4", - nullable=True, - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - _args_schema.allocation_method = AAZStrArg( - options=["--allocation-method"], - help="IP address allocation method. Allowed values: Dynamic, Static.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _args_schema.sku = AAZStrArg( - options=["--sku"], - help="Name of a public IP address SKU.", - nullable=True, - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "DnsSettings" - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PublicIPAddressesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.PublicIPAddressesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class PublicIPAddressesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_public_ip_address_read(cls._schema_on_200) - - return cls._schema_on_200 - - class PublicIPAddressesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_public_ip_address_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("sku", AAZObjectType) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout") - properties.set_prop("publicIPAddressVersion", AAZStrType, ".version") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".allocation_method") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".dns_name") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - sku = _builder.get(".sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".sku") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType( - flags={"read_only": True} - ) - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.location = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - application_security_group_read.tags = AAZDictType( - flags={"read_only": True}, - ) - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - flags={"read_only": True}, - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - flags={"read_only": True}, - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - flags={"read_only": True}, - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - flags={"read_only": True}, - ) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - flags={"read_only": True}, - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType( - flags={"read_only": True}, - ) - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - flags={"read_only": True}, - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"read_only": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - flags={"read_only": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"read_only": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType( - flags={"read_only": True} - ) - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.location = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - network_security_group_read.tags = AAZDictType( - flags={"read_only": True}, - ) - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - flags={"read_only": True}, - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.location = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - _element.tags = AAZDictType( - flags={"read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - flags={"read_only": True}, - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - flags={"read_only": True}, - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - flags={"read_only": True}, - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - flags={"read_only": True}, - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - flags={"read_only": True}, - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - flags={"read_only": True}, - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - flags={"read_only": True}, - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType( - flags={"read_only": True} - ) - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.id = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.name = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.description = AAZStrType( - flags={"read_only": True}, - ) - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"read_only": True}, - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - flags={"read_only": True}, - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - flags={"read_only": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - flags={"read_only": True}, - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - flags={"read_only": True}, - ) - properties.direction = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.priority = AAZIntType( - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"read_only": True}, - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - flags={"read_only": True}, - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - flags={"read_only": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - flags={"read_only": True}, - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - flags={"read_only": True}, - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType( - flags={"read_only": True}, - ) - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType( - flags={"read_only": True}, - ) - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType( - flags={"read_only": True}, - ) - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType( - flags={"read_only": True} - ) - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType( - flags={"read_only": True}, - ) - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType( - flags={"read_only": True} - ) - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.id = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.name = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - flags={"read_only": True}, - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - flags={"read_only": True}, - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - flags={"read_only": True}, - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType( - flags={"read_only": True}, - ) - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType( - flags={"read_only": True}, - ) - route_table.id = AAZStrType( - flags={"read_only": True}, - ) - route_table.location = AAZStrType( - flags={"read_only": True}, - ) - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - route_table.tags = AAZDictType( - flags={"read_only": True}, - ) - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.routes = AAZListType( - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - flags={"read_only": True}, - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType( - flags={"read_only": True}, - ) - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - _element.service = AAZStrType( - flags={"read_only": True}, - ) - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_wait.py deleted file mode 100644 index 825640672be..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/public_ip/_wait.py +++ /dev/null @@ -1,1191 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP address.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PublicIPAddressesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class PublicIPAddressesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_public_ip_address_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType( - flags={"read_only": True} - ) - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.location = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - application_security_group_read.tags = AAZDictType( - flags={"read_only": True}, - ) - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType( - flags={"read_only": True} - ) - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - flags={"read_only": True}, - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - flags={"read_only": True}, - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - flags={"read_only": True}, - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - flags={"read_only": True}, - ) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - flags={"read_only": True}, - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - flags={"read_only": True}, - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - flags={"read_only": True}, - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType( - flags={"read_only": True}, - ) - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - flags={"read_only": True}, - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"read_only": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - flags={"read_only": True}, - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"read_only": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType( - flags={"read_only": True} - ) - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.id = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.location = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - network_security_group_read.tags = AAZDictType( - flags={"read_only": True}, - ) - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - flags={"read_only": True}, - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.location = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - _element.tags = AAZDictType( - flags={"read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - flags={"read_only": True}, - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - flags={"read_only": True}, - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - flags={"read_only": True}, - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - flags={"read_only": True}, - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - flags={"read_only": True}, - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - flags={"read_only": True}, - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - flags={"read_only": True}, - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - flags={"read_only": True}, - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType( - flags={"read_only": True}, - ) - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType( - flags={"read_only": True} - ) - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.id = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.name = AAZStrType( - flags={"read_only": True}, - ) - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.description = AAZStrType( - flags={"read_only": True}, - ) - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - flags={"read_only": True}, - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - flags={"read_only": True}, - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - flags={"read_only": True}, - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - flags={"read_only": True}, - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - flags={"read_only": True}, - ) - properties.direction = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.priority = AAZIntType( - flags={"read_only": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - flags={"read_only": True}, - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - flags={"read_only": True}, - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - flags={"read_only": True}, - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - flags={"read_only": True}, - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - flags={"read_only": True}, - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType( - flags={"read_only": True}, - ) - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType( - flags={"read_only": True}, - ) - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType( - flags={"read_only": True}, - ) - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType( - flags={"read_only": True} - ) - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType( - flags={"read_only": True}, - ) - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType( - flags={"read_only": True} - ) - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.id = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.name = AAZStrType( - flags={"read_only": True}, - ) - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - flags={"read_only": True}, - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - flags={"read_only": True}, - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - flags={"read_only": True}, - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - flags={"read_only": True}, - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType( - flags={"read_only": True}, - ) - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType( - flags={"read_only": True}, - ) - route_table.id = AAZStrType( - flags={"read_only": True}, - ) - route_table.location = AAZStrType( - flags={"read_only": True}, - ) - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - route_table.tags = AAZDictType( - flags={"read_only": True}, - ) - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.routes = AAZListType( - flags={"read_only": True}, - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True, "read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - flags={"read_only": True}, - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - flags={"read_only": True}, - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True, "read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType( - flags={"read_only": True}, - ) - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType( - flags={"read_only": True}, - ) - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType( - flags={"read_only": True}, - ) - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType( - flags={"read_only": True}, - ) - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - _element.service = AAZStrType( - flags={"read_only": True}, - ) - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType( - flags={"read_only": True}, - ) - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/__cmd_group.py deleted file mode 100644 index 88087e0bdc5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 route-table", -) -class __CMDGroup(AAZCommandGroup): - """Manage route tables. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_create.py deleted file mode 100644 index ccfbdbb9be5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_create.py +++ /dev/null @@ -1,1028 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table create", -) -class Create(AAZCommand): - """Create a route table. - - :example: Create a route table. - az network route-table create -g MyResourceGroup -n MyRouteTable - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the route table.", - required=True, - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - arg_group="Parameters", - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Parameters", - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.disable_bgp_route_propagation = AAZBoolArg( - options=["--disable-bgp-route-propagation"], - arg_group="Properties", - help="Disable routes learned by BGP. Allowed values: false, true.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.RouteTablesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RouteTablesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("disableBgpRoutePropagation", AAZBoolType, ".disable_bgp_route_propagation") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_route_table_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_route_table_read = None - - @classmethod - def _build_schema_route_table_read(cls, _schema): - if cls._schema_route_table_read is not None: - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - return - - cls._schema_route_table_read = _schema_route_table_read = AAZObjectType() - - route_table_read = _schema_route_table_read - route_table_read.etag = AAZStrType() - route_table_read.id = AAZStrType() - route_table_read.location = AAZStrType() - route_table_read.name = AAZStrType( - flags={"read_only": True}, - ) - route_table_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table_read.tags = AAZDictType() - route_table_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_route_table_read.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_route_table_read.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_route_table_read.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_table_read.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_route_table_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_route_table_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - cls._build_schema_route_table_read(properties.route_table) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_delete.py deleted file mode 100644 index 152c0fc56d2..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_delete.py +++ /dev/null @@ -1,163 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table delete", - confirmation="Are you sure you want to perform this operation?", -) -class Delete(AAZCommand): - """Delete a route table. - - :example: Delete a route table. - az network route-table delete -g MyResourceGroup -n MyRouteTable - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the route table.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.RouteTablesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class RouteTablesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_list.py deleted file mode 100644 index ca620c15167..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_list.py +++ /dev/null @@ -1,1047 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table list", -) -class List(AAZCommand): - """List route tables. - - :example: List all route tables in a subscription. - az network route-table list -g MyResourceGroup - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/routetables", "2017-10-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.RouteTablesList(ctx=self.ctx)() - if condition_1: - self.RouteTablesListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class RouteTablesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_route_table_read(value.Element) - - return cls._schema_on_200 - - class RouteTablesListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_route_table_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_route_table_read = None - - @classmethod - def _build_schema_route_table_read(cls, _schema): - if cls._schema_route_table_read is not None: - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - return - - cls._schema_route_table_read = _schema_route_table_read = AAZObjectType() - - route_table_read = _schema_route_table_read - route_table_read.etag = AAZStrType() - route_table_read.id = AAZStrType() - route_table_read.location = AAZStrType() - route_table_read.name = AAZStrType( - flags={"read_only": True}, - ) - route_table_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table_read.tags = AAZDictType() - route_table_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_route_table_read.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_route_table_read.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_route_table_read.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_table_read.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_route_table_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_route_table_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - cls._build_schema_route_table_read(properties.route_table) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_show.py deleted file mode 100644 index 70b30442af9..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_show.py +++ /dev/null @@ -1,967 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table show", -) -class Show(AAZCommand): - """Get the details of a route table. - - :example: Get the details of a route table. - az network route-table show -g MyResourceGroup -n MyRouteTable - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the route table.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RouteTablesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RouteTablesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_route_table_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_route_table_read = None - - @classmethod - def _build_schema_route_table_read(cls, _schema): - if cls._schema_route_table_read is not None: - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - return - - cls._schema_route_table_read = _schema_route_table_read = AAZObjectType() - - route_table_read = _schema_route_table_read - route_table_read.etag = AAZStrType() - route_table_read.id = AAZStrType() - route_table_read.location = AAZStrType() - route_table_read.name = AAZStrType( - flags={"read_only": True}, - ) - route_table_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table_read.tags = AAZDictType() - route_table_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_route_table_read.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_route_table_read.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_route_table_read.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_table_read.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_route_table_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_route_table_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - cls._build_schema_route_table_read(properties.route_table) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_update.py deleted file mode 100644 index ef570ea5422..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_update.py +++ /dev/null @@ -1,1144 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table update", -) -class Update(AAZCommand): - """Update a route table. - - :example: Update a route table to disable BGP route propagation. - az network route-table update -g MyResourceGroup -n MyRouteTable --disable-bgp-route-propagation true - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the route table.", - required=True, - id_part="name", - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Parameters", - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.disable_bgp_route_propagation = AAZBoolArg( - options=["--disable-bgp-route-propagation"], - arg_group="Properties", - help="Disable routes learned by BGP. Allowed values: false, true.", - nullable=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RouteTablesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.RouteTablesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RouteTablesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_route_table_read(cls._schema_on_200) - - return cls._schema_on_200 - - class RouteTablesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_route_table_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("disableBgpRoutePropagation", AAZBoolType, ".disable_bgp_route_propagation") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_route_table_read = None - - @classmethod - def _build_schema_route_table_read(cls, _schema): - if cls._schema_route_table_read is not None: - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - return - - cls._schema_route_table_read = _schema_route_table_read = AAZObjectType() - - route_table_read = _schema_route_table_read - route_table_read.etag = AAZStrType() - route_table_read.id = AAZStrType() - route_table_read.location = AAZStrType() - route_table_read.name = AAZStrType( - flags={"read_only": True}, - ) - route_table_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table_read.tags = AAZDictType() - route_table_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_route_table_read.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_route_table_read.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_route_table_read.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_table_read.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_route_table_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_route_table_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - cls._build_schema_route_table_read(properties.route_table) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_wait.py deleted file mode 100644 index a0e8e247578..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/_wait.py +++ /dev/null @@ -1,963 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the route table.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RouteTablesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class RouteTablesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_route_table_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_route_table_read = None - - @classmethod - def _build_schema_route_table_read(cls, _schema): - if cls._schema_route_table_read is not None: - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - return - - cls._schema_route_table_read = _schema_route_table_read = AAZObjectType() - - route_table_read = _schema_route_table_read - route_table_read.etag = AAZStrType() - route_table_read.id = AAZStrType() - route_table_read.location = AAZStrType() - route_table_read.name = AAZStrType( - flags={"read_only": True}, - ) - route_table_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table_read.tags = AAZDictType() - route_table_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_route_table_read.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_route_table_read.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_route_table_read.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_table_read.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_route_table_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_route_table_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - cls._build_schema_route_table_read(properties.route_table) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/__cmd_group.py deleted file mode 100644 index 1eeb0b10800..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 route-table route", -) -class __CMDGroup(AAZCommandGroup): - """Manage routes in a route table. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_create.py deleted file mode 100644 index e0faa33919a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_create.py +++ /dev/null @@ -1,253 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route create", -) -class Create(AAZCommand): - """Create a route in a route table. - - :example: Create a route that forces all inbound traffic to a Network Virtual Appliance. - az network route-table route create -g MyResourceGroup --route-table-name MyRouteTable -n MyRoute --next-hop-type VirtualAppliance --address-prefix 10.0.0.0/16 --next-hop-ip-address 10.0.100.4 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Route name.", - required=True, - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.address_prefix = AAZStrArg( - options=["--address-prefix"], - arg_group="Properties", - help="The destination CIDR to which the route applies.", - ) - _args_schema.next_hop_ip_address = AAZStrArg( - options=["--next-hop-ip-address"], - arg_group="Properties", - help="The IP address packets should be forwarded to when using the VirtualAppliance hop type.", - ) - _args_schema.next_hop_type = AAZStrArg( - options=["--next-hop-type"], - arg_group="Properties", - help="The type of Azure hop the packet should be sent to.", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - - # define Arg Group "RouteParameters" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.RoutesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RoutesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.name = AAZStrType() - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_delete.py deleted file mode 100644 index f2f65ee8849..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_delete.py +++ /dev/null @@ -1,173 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route delete", - confirmation="Are you sure you want to perform this operation?", -) -class Delete(AAZCommand): - """Delete a route from a route table. - - :example: Delete a route from a route table. - az network route-table route delete -g MyResourceGroup --route-table-name MyRouteTable -n MyRoute - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Route name.", - required=True, - id_part="child_name_1", - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.RoutesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class RoutesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_list.py deleted file mode 100644 index b3a4f13a6d4..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_list.py +++ /dev/null @@ -1,193 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route list", -) -class List(AAZCommand): - """List routes in a route table. - - :example: List routes in a route table. - az network route-table route list -g MyResourceGroup --route-table-name MyRouteTable - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RoutesList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class RoutesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_show.py deleted file mode 100644 index 46a6030ca41..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_show.py +++ /dev/null @@ -1,195 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route show", -) -class Show(AAZCommand): - """Get the details of a route in a route table. - - :example: Get the details of a route in a route table. - az network route-table route show -g MyResourceGroup --route-table-name MyRouteTable -n MyRoute -o table - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Route name.", - required=True, - id_part="child_name_1", - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RoutesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RoutesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_update.py deleted file mode 100644 index 3424a35263d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_update.py +++ /dev/null @@ -1,402 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route update", -) -class Update(AAZCommand): - """Update a route in a route table. - - :example: Update a route in a route table to change the next hop ip address. - az network route-table route update -g MyResourceGroup --route-table-name MyRouteTable -n MyRoute --next-hop-ip-address 10.0.100.5 - - :example: Update a route in a route table. - az network route-table route update --address-prefix 10.0.0.0/16 --name MyRoute --next-hop-ip-address 10.0.100.5 --next-hop-type VirtualNetworkGateway --resource-group MyResourceGroup --route-table-name MyRouteTable - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Route name.", - required=True, - id_part="child_name_1", - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - id_part="name", - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.address_prefix = AAZStrArg( - options=["--address-prefix"], - arg_group="Properties", - help="The destination CIDR to which the route applies.", - nullable=True, - ) - _args_schema.next_hop_ip_address = AAZStrArg( - options=["--next-hop-ip-address"], - arg_group="Properties", - help="The IP address packets should be forwarded to when using the VirtualAppliance hop type.", - nullable=True, - ) - _args_schema.next_hop_type = AAZStrArg( - options=["--next-hop-type"], - arg_group="Properties", - help="The type of Azure hop the packet should be sent to.", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - - # define Arg Group "RouteParameters" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RoutesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.RoutesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RoutesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_route_read(cls._schema_on_200) - - return cls._schema_on_200 - - class RoutesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_route_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_route_read = None - - @classmethod - def _build_schema_route_read(cls, _schema): - if cls._schema_route_read is not None: - _schema.etag = cls._schema_route_read.etag - _schema.id = cls._schema_route_read.id - _schema.name = cls._schema_route_read.name - _schema.properties = cls._schema_route_read.properties - return - - cls._schema_route_read = _schema_route_read = AAZObjectType() - - route_read = _schema_route_read - route_read.etag = AAZStrType() - route_read.id = AAZStrType() - route_read.name = AAZStrType() - route_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_route_read.etag - _schema.id = cls._schema_route_read.id - _schema.name = cls._schema_route_read.name - _schema.properties = cls._schema_route_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_wait.py deleted file mode 100644 index cb2fc26b833..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/route_table/route/_wait.py +++ /dev/null @@ -1,191 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Route name.", - required=True, - id_part="child_name_1", - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RoutesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class RoutesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/__cmd_group.py deleted file mode 100644 index 8db8cccf4a5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet", -) -class __CMDGroup(AAZCommandGroup): - """Check if a private IP address is available for use within a virtual network. - - To learn more about Virtual Networks visit https://learn.microsoft.com/azure/virtual-network/virtual-network-manage-network. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/__init__.py deleted file mode 100644 index c352aa0e33a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._check_ip_address import * -from ._create import * -from ._delete import * -from ._list import * -from ._list_endpoint_services import * -from ._show import * -from ._update import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_check_ip_address.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_check_ip_address.py deleted file mode 100644 index b2e9bd8190d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_check_ip_address.py +++ /dev/null @@ -1,178 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet check-ip-address", -) -class CheckIpAddress(AAZCommand): - """Check if a private IP address is available for use within a virtual network. - - :example: Check whether 10.0.0.4 is available within MyVnet. - az network vnet check-ip-address -g MyResourceGroup -n MyVnet --ip-address 10.0.0.4 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/checkipaddressavailability", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.ip_address = AAZStrArg( - options=["--ip-address"], - help="The private IP address to be verified.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworksCheckIPAddressAvailability(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworksCheckIPAddressAvailability(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "ipAddress", self.ctx.args.ip_address, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.available = AAZBoolType() - _schema_on_200.available_ip_addresses = AAZListType( - serialized_name="availableIPAddresses", - ) - - available_ip_addresses = cls._schema_on_200.available_ip_addresses - available_ip_addresses.Element = AAZStrType() - - return cls._schema_on_200 - - -class _CheckIpAddressHelper: - """Helper class for CheckIpAddress""" - - -__all__ = ["CheckIpAddress"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_create.py deleted file mode 100644 index f33f97198ae..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_create.py +++ /dev/null @@ -1,1855 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet create", -) -class Create(AAZCommand): - """Create a virtual network. - - You may also create a subnet at the same time by specifying a subnet name and (optionally) an address prefix. To learn about how to create a virtual network visit https://learn.microsoft.com/azure/virtual-network/manage-virtual-network#create-a-virtual-network. - - :example: Create a virtual network with a specific address prefix and one subnet. - az network vnet create -g MyResourceGroup -n MyVnet --address-prefix 10.0.0.0/16 --subnet-name MySubnet --subnet-prefixes 10.0.0.0/24 - - :example: Create a virtual network. - az network vnet create --address-prefixes 10.0.0.0/16 --name MyVirtualNetwork --resource-group MyResourceGroup --subnet-name MyAseSubnet --subnet-prefixes 10.0.0.0/24 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.address_prefixes = AAZListArg( - options=["--address-prefixes"], - help="Space-separated list of IP address prefixes for the VNet. Default: 10.0.0.0/16.", - default=["10.0.0.0/16"], - ) - _args_schema.dns_servers = AAZListArg( - options=["--dns-servers"], - help="Space-separated list of DNS server IP addresses.", - ) - _args_schema.ddos_protection = AAZBoolArg( - options=["--ddos-protection"], - help="Control whether DDoS protection is enabled.", - default=False, - ) - _args_schema.vm_protection = AAZBoolArg( - options=["--vm-protection"], - help="Enable VM protection for all subnets in the VNet.", - default=False, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - address_prefixes = cls._args_schema.address_prefixes - address_prefixes.Element = AAZStrArg() - - dns_servers = cls._args_schema.dns_servers - dns_servers.Element = AAZStrArg() - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - # define Arg Group "Subnet" - - _args_schema = cls._args_schema - _args_schema.subnets = AAZListArg( - options=["--subnets"], - arg_group="Subnet", - help="Manage a list of subnets in a Virtual Network (similar to `az network vnet subnet`).", - ) - - subnets = cls._args_schema.subnets - subnets.Element = AAZObjectArg() - - _element = cls._args_schema.subnets.Element - _element.name = AAZStrArg( - options=["name"], - help="The subnet name.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - _element.network_security_group = AAZObjectArg( - options=["nsg", "network-security-group"], - help="The reference to the NetworkSecurityGroup resource.", - ) - _element.route_table = AAZObjectArg( - options=["route-table"], - help="The reference to the RouteTable resource.", - ) - _element.service_endpoints = AAZListArg( - options=["service-endpoints"], - help="An array of service endpoints.", - ) - - network_security_group = cls._args_schema.subnets.Element.network_security_group - network_security_group.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_security_group.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - network_security_group.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - network_security_group.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - network_security_group.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_schema.subnets.Element.network_security_group.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_create(default_security_rules.Element) - - security_rules = cls._args_schema.subnets.Element.network_security_group.security_rules - security_rules.Element = AAZObjectArg() - - _element = cls._args_schema.subnets.Element.network_security_group.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - _element.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.", - ) - _element.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - _element.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_schema.subnets.Element.network_security_group.security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_schema.subnets.Element.network_security_group.security_rules.Element.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_schema.subnets.Element.network_security_group.security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_schema.subnets.Element.network_security_group.security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_schema.subnets.Element.network_security_group.security_rules.Element.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_schema.subnets.Element.network_security_group.security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - tags = cls._args_schema.subnets.Element.network_security_group.tags - tags.Element = AAZStrArg() - - route_table = cls._args_schema.subnets.Element.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.disable_bgp_route_propagation = AAZBoolArg( - options=["disable-bgp-route-propagation"], - help="Whether to disable the routes learned by BGP on that route table. True means disable.", - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_schema.subnets.Element.route_table.routes - routes.Element = AAZObjectArg() - - _element = cls._args_schema.subnets.Element.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to.", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - tags = cls._args_schema.subnets.Element.route_table.tags - tags.Element = AAZStrArg() - - service_endpoints = cls._args_schema.subnets.Element.service_endpoints - service_endpoints.Element = AAZObjectArg() - - _element = cls._args_schema.subnets.Element.service_endpoints.Element - _element.locations = AAZListArg( - options=["locations"], - help="A list of locations.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - ) - _element.service = AAZStrArg( - options=["service"], - help="The type of the endpoint service.", - ) - - locations = cls._args_schema.subnets.Element.service_endpoints.Element.locations - locations.Element = AAZStrArg() - return cls._args_schema - - _args_address_space_create = None - - @classmethod - def _build_args_address_space_create(cls, _schema): - if cls._args_address_space_create is not None: - _schema.address_prefixes = cls._args_address_space_create.address_prefixes - return - - cls._args_address_space_create = AAZObjectArg() - - address_space_create = cls._args_address_space_create - address_space_create.address_prefixes = AAZListArg( - options=["address-prefixes"], - help="A list of address blocks reserved for this virtual network in CIDR notation.", - ) - - address_prefixes = cls._args_address_space_create.address_prefixes - address_prefixes.Element = AAZStrArg() - - _schema.address_prefixes = cls._args_address_space_create.address_prefixes - - _args_application_security_group_create = None - - @classmethod - def _build_args_application_security_group_create(cls, _schema): - if cls._args_application_security_group_create is not None: - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - return - - cls._args_application_security_group_create = AAZObjectArg() - - application_security_group_create = cls._args_application_security_group_create - application_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - security_rule_create.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - security_rule_create.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_create.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworksCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworksCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressSpace", AAZObjectType) - properties.set_prop("dhcpOptions", AAZObjectType) - properties.set_prop("enableDdosProtection", AAZBoolType, ".ddos_protection") - properties.set_prop("enableVmProtection", AAZBoolType, ".vm_protection") - properties.set_prop("subnets", AAZListType, ".subnets") - - address_space = _builder.get(".properties.addressSpace") - if address_space is not None: - address_space.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".properties.addressSpace.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - dhcp_options = _builder.get(".properties.dhcpOptions") - if dhcp_options is not None: - dhcp_options.set_prop("dnsServers", AAZListType, ".dns_servers") - - dns_servers = _builder.get(".properties.dhcpOptions.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - subnets.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.subnets[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.subnets[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - properties.set_prop("serviceEndpoints", AAZListType, ".service_endpoints") - - network_security_group = _builder.get(".properties.subnets[].properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("etag", AAZStrType, ".etag") - network_security_group.set_prop("id", AAZStrType, ".id") - network_security_group.set_prop("location", AAZStrType, ".location") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - network_security_group.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - - default_security_rules = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.defaultSecurityRules") - if default_security_rules is not None: - _CreateHelper._build_schema_security_rule_create(default_security_rules.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - _CreateHelper._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - _CreateHelper._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.subnets[].properties.networkSecurityGroup.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - route_table = _builder.get(".properties.subnets[].properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.subnets[].properties.routeTable.properties") - if properties is not None: - properties.set_prop("disableBgpRoutePropagation", AAZBoolType, ".disable_bgp_route_propagation") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - - routes = _builder.get(".properties.subnets[].properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.subnets[].properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.subnets[].properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - tags = _builder.get(".properties.subnets[].properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - service_endpoints = _builder.get(".properties.subnets[].properties.serviceEndpoints") - if service_endpoints is not None: - service_endpoints.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.subnets[].properties.serviceEndpoints[]") - if _elements is not None: - _elements.set_prop("locations", AAZListType, ".locations") - _elements.set_prop("provisioningState", AAZStrType, ".provisioning_state") - _elements.set_prop("service", AAZStrType, ".service") - - locations = _builder.get(".properties.subnets[].properties.serviceEndpoints[].locations") - if locations is not None: - locations.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.location = AAZStrType() - _schema_on_200_201.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200_201.tags = AAZDictType() - _schema_on_200_201.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - _CreateHelper._build_schema_address_space_read(properties.address_space) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.enable_ddos_protection = AAZBoolType( - serialized_name="enableDdosProtection", - ) - properties.enable_vm_protection = AAZBoolType( - serialized_name="enableVmProtection", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - properties.virtual_network_peerings = AAZListType( - serialized_name="virtualNetworkPeerings", - ) - - dhcp_options = cls._schema_on_200_201.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = cls._schema_on_200_201.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = cls._schema_on_200_201.properties.subnets - subnets.Element = AAZObjectType() - _CreateHelper._build_schema_subnet_read(subnets.Element) - - virtual_network_peerings = cls._schema_on_200_201.properties.virtual_network_peerings - virtual_network_peerings.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.virtual_network_peerings.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.virtual_network_peerings.Element.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - _CreateHelper._build_schema_address_space_read(properties.remote_address_space) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - _CreateHelper._build_schema_sub_resource_read(properties.remote_virtual_network) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - tags = cls._schema_on_200_201.tags - tags.Element = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_address_space_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_application_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_delete.py deleted file mode 100644 index 9daac28ee53..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet delete", -) -class Delete(AAZCommand): - """Delete a virtual network. - - :example: Delete a virtual network. - az network vnet delete -g MyResourceGroup -n myVNet - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworksDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class VirtualNetworksDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_list.py deleted file mode 100644 index 1aec423eab0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_list.py +++ /dev/null @@ -1,1234 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet list", -) -class List(AAZCommand): - """List virtual networks. - - :example: List all virtual networks in a subscription. - az network vnet list - - :example: List all virtual networks in a resource group. - az network vnet list -g MyResourceGroup - - :example: List virtual networks in a subscription which specify a certain address prefix. - az network vnet list --query "[?contains(addressSpace.addressPrefixes, '10.0.0.0/16')]" - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/virtualnetworks", "2017-10-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.VirtualNetworksList(ctx=self.ctx)() - if condition_1: - self.VirtualNetworksListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class VirtualNetworksList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - _ListHelper._build_schema_address_space_read(properties.address_space) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.enable_ddos_protection = AAZBoolType( - serialized_name="enableDdosProtection", - ) - properties.enable_vm_protection = AAZBoolType( - serialized_name="enableVmProtection", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - properties.virtual_network_peerings = AAZListType( - serialized_name="virtualNetworkPeerings", - ) - - dhcp_options = cls._schema_on_200.value.Element.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = cls._schema_on_200.value.Element.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = cls._schema_on_200.value.Element.properties.subnets - subnets.Element = AAZObjectType() - _ListHelper._build_schema_subnet_read(subnets.Element) - - virtual_network_peerings = cls._schema_on_200.value.Element.properties.virtual_network_peerings - virtual_network_peerings.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.virtual_network_peerings.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.virtual_network_peerings.Element.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - _ListHelper._build_schema_address_space_read(properties.remote_address_space) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - _ListHelper._build_schema_sub_resource_read(properties.remote_virtual_network) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - class VirtualNetworksListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - _ListHelper._build_schema_address_space_read(properties.address_space) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.enable_ddos_protection = AAZBoolType( - serialized_name="enableDdosProtection", - ) - properties.enable_vm_protection = AAZBoolType( - serialized_name="enableVmProtection", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - properties.virtual_network_peerings = AAZListType( - serialized_name="virtualNetworkPeerings", - ) - - dhcp_options = cls._schema_on_200.value.Element.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = cls._schema_on_200.value.Element.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = cls._schema_on_200.value.Element.properties.subnets - subnets.Element = AAZObjectType() - _ListHelper._build_schema_subnet_read(subnets.Element) - - virtual_network_peerings = cls._schema_on_200.value.Element.properties.virtual_network_peerings - virtual_network_peerings.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.virtual_network_peerings.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.virtual_network_peerings.Element.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - _ListHelper._build_schema_address_space_read(properties.remote_address_space) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - _ListHelper._build_schema_sub_resource_read(properties.remote_virtual_network) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_list_endpoint_services.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_list_endpoint_services.py deleted file mode 100644 index bd3bb286884..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_list_endpoint_services.py +++ /dev/null @@ -1,172 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet list-endpoint-services", -) -class ListEndpointServices(AAZCommand): - """List which services support VNet service tunneling in a given region. - - To learn more about service endpoints visit https://learn.microsoft.com/azure/virtual-network/virtual-network-service-endpoints-configure#azure-cli. - - :example: List the endpoint services available for use in the West US region. - az network vnet list-endpoint-services -l westus -o table - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/locations/{}/virtualnetworkavailableendpointservices", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.AvailableEndpointServicesList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class AvailableEndpointServicesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "location", self.ctx.args.location, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.id = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - return cls._schema_on_200 - - -class _ListEndpointServicesHelper: - """Helper class for ListEndpointServices""" - - -__all__ = ["ListEndpointServices"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_show.py deleted file mode 100644 index 6d1881b2615..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_show.py +++ /dev/null @@ -1,1055 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet show", -) -class Show(AAZCommand): - """Get the details of a virtual network. - - :example: Get details for MyVNet. - az network vnet show -g MyResourceGroup -n MyVNet - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworksGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworksGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - _ShowHelper._build_schema_address_space_read(properties.address_space) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.enable_ddos_protection = AAZBoolType( - serialized_name="enableDdosProtection", - ) - properties.enable_vm_protection = AAZBoolType( - serialized_name="enableVmProtection", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - properties.virtual_network_peerings = AAZListType( - serialized_name="virtualNetworkPeerings", - ) - - dhcp_options = cls._schema_on_200.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = cls._schema_on_200.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = cls._schema_on_200.properties.subnets - subnets.Element = AAZObjectType() - _ShowHelper._build_schema_subnet_read(subnets.Element) - - virtual_network_peerings = cls._schema_on_200.properties.virtual_network_peerings - virtual_network_peerings.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.virtual_network_peerings.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.virtual_network_peerings.Element.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - _ShowHelper._build_schema_address_space_read(properties.remote_address_space) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - _ShowHelper._build_schema_sub_resource_read(properties.remote_virtual_network) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_update.py deleted file mode 100644 index f75448e76e1..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_update.py +++ /dev/null @@ -1,1603 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet update", -) -class Update(AAZCommand): - """Update a virtual network. - - :example: Update a virtual network with the IP address of a DNS server. - az network vnet update -g MyResourceGroup -n MyVNet --dns-servers 10.2.0.8 - - :example: Update a virtual network. - az network vnet update --address-prefixes 40.1.0.0/24 --name MyVNet --resource-group MyResourceGroup - - :example: Update a virtual network to delete DNS server. - az network vnet update -g MyResourceGroup -n MyVNet --dns-servers null - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.address_prefixes = AAZListArg( - options=["--address-prefixes"], - help="Space-separated list of IP address prefixes for the VNet.", - nullable=True, - ) - _args_schema.dns_servers = AAZListArg( - options=["--dns-servers"], - help="Space-separated list of DNS server IP addresses.", - nullable=True, - ) - _args_schema.ddos_protection = AAZBoolArg( - options=["--ddos-protection"], - help="Control whether DDoS protection is enabled.", - nullable=True, - ) - _args_schema.vm_protection = AAZBoolArg( - options=["--vm-protection"], - help="Enable VM protection for all subnets in the VNet.", - nullable=True, - ) - - address_prefixes = cls._args_schema.address_prefixes - address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - dns_servers = cls._args_schema.dns_servers - dns_servers.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - return cls._args_schema - - _args_address_space_update = None - - @classmethod - def _build_args_address_space_update(cls, _schema): - if cls._args_address_space_update is not None: - _schema.address_prefixes = cls._args_address_space_update.address_prefixes - return - - cls._args_address_space_update = AAZObjectArg( - nullable=True, - ) - - address_space_update = cls._args_address_space_update - address_space_update.address_prefixes = AAZListArg( - options=["address-prefixes"], - help="A list of address blocks reserved for this virtual network in CIDR notation.", - nullable=True, - ) - - address_prefixes = cls._args_address_space_update.address_prefixes - address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - _schema.address_prefixes = cls._args_address_space_update.address_prefixes - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworksGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.VirtualNetworksCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworksGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworksCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressSpace", AAZObjectType) - properties.set_prop("dhcpOptions", AAZObjectType) - properties.set_prop("enableDdosProtection", AAZBoolType, ".ddos_protection") - properties.set_prop("enableVmProtection", AAZBoolType, ".vm_protection") - - address_space = _builder.get(".properties.addressSpace") - if address_space is not None: - address_space.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".properties.addressSpace.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - dhcp_options = _builder.get(".properties.dhcpOptions") - if dhcp_options is not None: - dhcp_options.set_prop("dnsServers", AAZListType, ".dns_servers") - - dns_servers = _builder.get(".properties.dhcpOptions.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_address_space_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_read = None - - @classmethod - def _build_schema_virtual_network_read(cls, _schema): - if cls._schema_virtual_network_read is not None: - _schema.etag = cls._schema_virtual_network_read.etag - _schema.id = cls._schema_virtual_network_read.id - _schema.location = cls._schema_virtual_network_read.location - _schema.name = cls._schema_virtual_network_read.name - _schema.properties = cls._schema_virtual_network_read.properties - _schema.tags = cls._schema_virtual_network_read.tags - _schema.type = cls._schema_virtual_network_read.type - return - - cls._schema_virtual_network_read = _schema_virtual_network_read = AAZObjectType() - - virtual_network_read = _schema_virtual_network_read - virtual_network_read.etag = AAZStrType() - virtual_network_read.id = AAZStrType() - virtual_network_read.location = AAZStrType() - virtual_network_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_read.tags = AAZDictType() - virtual_network_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_read.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - cls._build_schema_address_space_read(properties.address_space) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.enable_ddos_protection = AAZBoolType( - serialized_name="enableDdosProtection", - ) - properties.enable_vm_protection = AAZBoolType( - serialized_name="enableVmProtection", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - properties.virtual_network_peerings = AAZListType( - serialized_name="virtualNetworkPeerings", - ) - - dhcp_options = _schema_virtual_network_read.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = _schema_virtual_network_read.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = _schema_virtual_network_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - virtual_network_peerings = _schema_virtual_network_read.properties.virtual_network_peerings - virtual_network_peerings.Element = AAZObjectType() - - _element = _schema_virtual_network_read.properties.virtual_network_peerings.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_read.properties.virtual_network_peerings.Element.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - cls._build_schema_address_space_read(properties.remote_address_space) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - cls._build_schema_sub_resource_read(properties.remote_virtual_network) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - tags = _schema_virtual_network_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_read.etag - _schema.id = cls._schema_virtual_network_read.id - _schema.location = cls._schema_virtual_network_read.location - _schema.name = cls._schema_virtual_network_read.name - _schema.properties = cls._schema_virtual_network_read.properties - _schema.tags = cls._schema_virtual_network_read.tags - _schema.type = cls._schema_virtual_network_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_wait.py deleted file mode 100644 index c284ccd1313..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/_wait.py +++ /dev/null @@ -1,1051 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworksGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworksGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - _WaitHelper._build_schema_address_space_read(properties.address_space) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.enable_ddos_protection = AAZBoolType( - serialized_name="enableDdosProtection", - ) - properties.enable_vm_protection = AAZBoolType( - serialized_name="enableVmProtection", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - properties.virtual_network_peerings = AAZListType( - serialized_name="virtualNetworkPeerings", - ) - - dhcp_options = cls._schema_on_200.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = cls._schema_on_200.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = cls._schema_on_200.properties.subnets - subnets.Element = AAZObjectType() - _WaitHelper._build_schema_subnet_read(subnets.Element) - - virtual_network_peerings = cls._schema_on_200.properties.virtual_network_peerings - virtual_network_peerings.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.virtual_network_peerings.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.virtual_network_peerings.Element.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - _WaitHelper._build_schema_address_space_read(properties.remote_address_space) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - _WaitHelper._build_schema_sub_resource_read(properties.remote_virtual_network) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/__cmd_group.py deleted file mode 100644 index f9d713b5a5d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet peering", -) -class __CMDGroup(AAZCommandGroup): - """Manage peering connections between Azure Virtual Networks. - - To learn more about virtual network peering visit https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-manage-peering. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_create.py deleted file mode 100644 index 2df24a73515..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_create.py +++ /dev/null @@ -1,289 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet peering create", -) -class Create(AAZCommand): - """Create a virtual network peering connection. - - To successfully peer two virtual networks this command must be called twice with the values for --vnet-name and --remote-vnet reversed. - - :example: Create a peering connection between two virtual networks. - az network vnet peering create -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1 --remote-vnet MyVnet2Id --allow-vnet-access - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/virtualnetworkpeerings/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the VNet peering.", - required=True, - ) - _args_schema.allow_forwarded_traffic = AAZBoolArg( - options=["--allow-forwarded-traffic"], - help="Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network.", - default=False, - ) - _args_schema.allow_gateway_transit = AAZBoolArg( - options=["--allow-gateway-transit"], - help="If gateway links can be used in remote virtual networking to link to this virtual network.", - default=False, - ) - _args_schema.allow_vnet_access = AAZBoolArg( - options=["--allow-vnet-access"], - help="Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space.", - default=False, - ) - _args_schema.remote_vnet = AAZStrArg( - options=["--remote-vnet"], - help="Name or ID of the remote VNet.", - ) - _args_schema.use_remote_gateways = AAZBoolArg( - options=["--use-remote-gateways"], - help="Allows VNet to use the remote VNet's gateway. Remote VNet gateway must have --allow-gateway-transit enabled for remote peering. Only 1 peering can have this flag enabled. Cannot be set if the VNet already has a gateway.", - default=False, - ) - - # define Arg Group "Properties" - - # define Arg Group "VirtualNetworkPeeringParameters" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkPeeringsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkPeeringsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkPeeringName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("allowForwardedTraffic", AAZBoolType, ".allow_forwarded_traffic") - properties.set_prop("allowGatewayTransit", AAZBoolType, ".allow_gateway_transit") - properties.set_prop("allowVirtualNetworkAccess", AAZBoolType, ".allow_vnet_access") - properties.set_prop("remoteVirtualNetwork", AAZObjectType) - properties.set_prop("useRemoteGateways", AAZBoolType, ".use_remote_gateways") - - remote_virtual_network = _builder.get(".properties.remoteVirtualNetwork") - if remote_virtual_network is not None: - remote_virtual_network.set_prop("id", AAZStrType, ".remote_vnet") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.name = AAZStrType() - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - remote_address_space = cls._schema_on_200_201.properties.remote_address_space - remote_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200_201.properties.remote_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - remote_virtual_network = cls._schema_on_200_201.properties.remote_virtual_network - remote_virtual_network.id = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_delete.py deleted file mode 100644 index 2b399f30cc1..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_delete.py +++ /dev/null @@ -1,172 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet peering delete", -) -class Delete(AAZCommand): - """Delete a peering. - - :example: Delete a virtual network peering connection. - az network vnet peering delete -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/virtualnetworkpeerings/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the VNet peering.", - required=True, - id_part="child_name_1", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkPeeringsDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class VirtualNetworkPeeringsDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkPeeringName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_list.py deleted file mode 100644 index 46e46536075..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_list.py +++ /dev/null @@ -1,215 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet peering list", -) -class List(AAZCommand): - """List peerings. - - :example: List all peerings of a specified virtual network. - az network vnet peering list -g MyResourceGroup --vnet-name MyVnet1 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/virtualnetworkpeerings", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkPeeringsList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class VirtualNetworkPeeringsList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - remote_address_space = cls._schema_on_200.value.Element.properties.remote_address_space - remote_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.value.Element.properties.remote_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - remote_virtual_network = cls._schema_on_200.value.Element.properties.remote_virtual_network - remote_virtual_network.id = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_show.py deleted file mode 100644 index 1720dd9e655..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_show.py +++ /dev/null @@ -1,217 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet peering show", -) -class Show(AAZCommand): - """Show details of a peering. - - :example: Show all details of the specified virtual network peering. - az network vnet peering show -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/virtualnetworkpeerings/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the VNet peering.", - required=True, - id_part="child_name_1", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkPeeringsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkPeeringsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkPeeringName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - remote_address_space = cls._schema_on_200.properties.remote_address_space - remote_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.remote_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - remote_virtual_network = cls._schema_on_200.properties.remote_virtual_network - remote_virtual_network.id = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_update.py deleted file mode 100644 index 3c44023cf6a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_update.py +++ /dev/null @@ -1,408 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet peering update", -) -class Update(AAZCommand): - """Update a peering. - - :example: Change forwarded traffic configuration of a virtual network peering. - az network vnet peering update -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1 --set allowForwardedTraffic=true - - :example: Change virtual network access of a virtual network peering. - az network vnet peering update -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1 --set allowVirtualNetworkAccess=true - - :example: Change gateway transit property configuration of a virtual network peering. - az network vnet peering update -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1 --set allowGatewayTransit=true - - :example: Use remote gateways in virtual network peering. - az network vnet peering update -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1 --set useRemoteGateways=true - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/virtualnetworkpeerings/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the VNet peering.", - required=True, - id_part="child_name_1", - ) - - # define Arg Group "Properties" - - # define Arg Group "VirtualNetworkPeeringParameters" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkPeeringsGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.VirtualNetworkPeeringsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkPeeringsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkPeeringName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_peering_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkPeeringsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkPeeringName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_peering_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("remoteVirtualNetwork", AAZObjectType) - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_virtual_network_peering_read = None - - @classmethod - def _build_schema_virtual_network_peering_read(cls, _schema): - if cls._schema_virtual_network_peering_read is not None: - _schema.etag = cls._schema_virtual_network_peering_read.etag - _schema.id = cls._schema_virtual_network_peering_read.id - _schema.name = cls._schema_virtual_network_peering_read.name - _schema.properties = cls._schema_virtual_network_peering_read.properties - return - - cls._schema_virtual_network_peering_read = _schema_virtual_network_peering_read = AAZObjectType() - - virtual_network_peering_read = _schema_virtual_network_peering_read - virtual_network_peering_read.etag = AAZStrType() - virtual_network_peering_read.id = AAZStrType() - virtual_network_peering_read.name = AAZStrType() - virtual_network_peering_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_peering_read.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - remote_address_space = _schema_virtual_network_peering_read.properties.remote_address_space - remote_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_peering_read.properties.remote_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - remote_virtual_network = _schema_virtual_network_peering_read.properties.remote_virtual_network - remote_virtual_network.id = AAZStrType() - - _schema.etag = cls._schema_virtual_network_peering_read.etag - _schema.id = cls._schema_virtual_network_peering_read.id - _schema.name = cls._schema_virtual_network_peering_read.name - _schema.properties = cls._schema_virtual_network_peering_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_wait.py deleted file mode 100644 index 3fc9ddace4e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/peering/_wait.py +++ /dev/null @@ -1,213 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet peering wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/virtualnetworkpeerings/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the VNet peering.", - required=True, - id_part="child_name_1", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkPeeringsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkPeeringsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkPeeringName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - remote_address_space = cls._schema_on_200.properties.remote_address_space - remote_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.remote_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - remote_virtual_network = cls._schema_on_200.properties.remote_virtual_network - remote_virtual_network.id = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/__cmd_group.py deleted file mode 100644 index 7d97ad0f39f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet subnet", -) -class __CMDGroup(AAZCommandGroup): - """Manage subnets in an Azure Virtual Network. - - To learn more about subnets visit https://learn.microsoft.com/azure/virtual-network/virtual-network-manage-subnet. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_create.py deleted file mode 100644 index 835c52fc6fb..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_create.py +++ /dev/null @@ -1,1304 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet create", -) -class Create(AAZCommand): - """Create a subnet and associate an existing NSG and route table. - - :example: Create new subnet attached to an NSG with a custom route table. - az network vnet subnet create -g MyResourceGroup --vnet-name MyVnet -n MySubnet --address-prefixes 10.0.0.0/24 --network-security-group MyNsg --route-table MyRouteTable - - :example: Create new subnet attached to a NAT gateway. - az network vnet subnet create -n MySubnet --vnet-name MyVnet -g MyResourceGroup --nat-gateway MyNatGateway --address-prefixes "10.0.0.0/21" - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The subnet name.", - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - ) - _args_schema.address_prefix = AAZStrArg( - options=["--address-prefix"], - help="The address prefix for the subnet.", - ) - _args_schema.network_security_group = AAZResourceIdArg( - options=["--nsg", "--network-security-group"], - help="Name or ID of a network security group (NSG).", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - _args_schema.route_table = AAZResourceIdArg( - options=["--route-table"], - help="Name or ID of a route table to associate with the subnet.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - _args_schema.endpoints = AAZListArg( - options=["--endpoints"], - help="An array of service endpoints.", - ) - - endpoints = cls._args_schema.endpoints - endpoints.Element = AAZObjectArg() - - _element = cls._args_schema.endpoints.Element - _element.locations = AAZListArg( - options=["locations"], - help="A list of locations.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - ) - _element.service = AAZStrArg( - options=["service"], - help="The type of the endpoint service.", - ) - - locations = cls._args_schema.endpoints.Element.locations - locations.Element = AAZStrArg() - - # define Arg Group "NetworkSecurityGroup" - - # define Arg Group "Properties" - - # define Arg Group "RouteTable" - - # define Arg Group "SubnetParameters" - return cls._args_schema - - _args_application_security_group_create = None - - @classmethod - def _build_args_application_security_group_create(cls, _schema): - if cls._args_application_security_group_create is not None: - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - return - - cls._args_application_security_group_create = AAZObjectArg() - - application_security_group_create = cls._args_application_security_group_create - application_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - security_rule_create.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - security_rule_create.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_create.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - - def _execute_operations(self): - self.pre_operations() - yield self.SubnetsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SubnetsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("networkSecurityGroup", AAZObjectType) - properties.set_prop("routeTable", AAZObjectType) - properties.set_prop("serviceEndpoints", AAZListType, ".endpoints") - - network_security_group = _builder.get(".properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("id", AAZStrType, ".network_security_group") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("id", AAZStrType, ".route_table") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - service_endpoints = _builder.get(".properties.serviceEndpoints") - if service_endpoints is not None: - service_endpoints.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpoints[]") - if _elements is not None: - _elements.set_prop("locations", AAZListType, ".locations") - _elements.set_prop("provisioningState", AAZStrType, ".provisioning_state") - _elements.set_prop("service", AAZStrType, ".service") - - locations = _builder.get(".properties.serviceEndpoints[].locations") - if locations is not None: - locations.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_subnet_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_application_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_delete.py deleted file mode 100644 index a0e93dc864c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_delete.py +++ /dev/null @@ -1,172 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet delete", -) -class Delete(AAZCommand): - """Delete a subnet. - - :example: Delete a subnet. - az network vnet subnet delete --name MySubnet --resource-group MyResourceGroup --vnet-name MyVnet - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The subnet name.", - required=True, - id_part="child_name_1", - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.SubnetsDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class SubnetsDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_list.py deleted file mode 100644 index 24d9fcce87a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_list.py +++ /dev/null @@ -1,943 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet list", -) -class List(AAZCommand): - """List the subnets in a virtual network. - - :example: List the subnets in a virtual network. - az network vnet subnet list -g MyResourceGroup --vnet-name MyVNet - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SubnetsList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class SubnetsList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_subnet_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_show.py deleted file mode 100644 index 329eb5c6f6b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_show.py +++ /dev/null @@ -1,952 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet show", -) -class Show(AAZCommand): - """Show details of a subnet. - - :example: Show the details of a subnet associated with a virtual network. - az network vnet subnet show -g MyResourceGroup -n MySubnet --vnet-name MyVNet - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The subnet name.", - required=True, - id_part="child_name_1", - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SubnetsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SubnetsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_subnet_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_update.py deleted file mode 100644 index fc162400bb3..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_update.py +++ /dev/null @@ -1,1482 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet update", -) -class Update(AAZCommand): - """Update a subnet. - - :example: Associate a network security group to a subnet. - az network vnet subnet update -g MyResourceGroup -n MySubnet --vnet-name MyVNet --network-security-group MyNsg - - :example: Update subnet with NAT gateway. - az network vnet subnet update -n MySubnet --vnet-name MyVnet -g MyResourceGroup --nat-gateway MyNatGateway --address-prefixes "10.0.0.0/21" - - :example: Disable the private endpoint network policies - az network vnet subnet update -n MySubnet --vnet-name MyVnet -g MyResourceGroup --disable-private-endpoint-network-policies - - :example: Detach a network security group in a subnet. - az network vnet subnet update -g MyResourceGroup --vnet-name MyVNet -n MySubnet --nsg null - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The subnet name.", - required=True, - id_part="child_name_1", - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.address_prefix = AAZStrArg( - options=["--address-prefix"], - help="The address prefix for the subnet.", - nullable=True, - ) - _args_schema.network_security_group = AAZResourceIdArg( - options=["--nsg", "--network-security-group"], - help="Name or ID of a network security group (NSG). Use null to detach it.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - _args_schema.route_table = AAZResourceIdArg( - options=["--route-table"], - help="Name or ID of a route table to associate with the subnet. Use null to detach it.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - _args_schema.endpoints = AAZListArg( - options=["--endpoints"], - help="An array of service endpoints.", - nullable=True, - ) - - endpoints = cls._args_schema.endpoints - endpoints.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.endpoints.Element - _element.locations = AAZListArg( - options=["locations"], - help="A list of locations.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - nullable=True, - ) - _element.service = AAZStrArg( - options=["service"], - help="The type of the endpoint service.", - nullable=True, - ) - - locations = cls._args_schema.endpoints.Element.locations - locations.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "NetworkSecurityGroup" - - # define Arg Group "Properties" - - # define Arg Group "RouteTable" - - # define Arg Group "SubnetParameters" - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - def _execute_operations(self): - self.pre_operations() - self.SubnetsGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.SubnetsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SubnetsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_subnet_read(cls._schema_on_200) - - return cls._schema_on_200 - - class SubnetsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_subnet_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("networkSecurityGroup", AAZObjectType) - properties.set_prop("routeTable", AAZObjectType) - properties.set_prop("serviceEndpoints", AAZListType, ".endpoints") - - network_security_group = _builder.get(".properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("id", AAZStrType, ".network_security_group") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("id", AAZStrType, ".route_table") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - service_endpoints = _builder.get(".properties.serviceEndpoints") - if service_endpoints is not None: - service_endpoints.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpoints[]") - if _elements is not None: - _elements.set_prop("locations", AAZListType, ".locations") - _elements.set_prop("provisioningState", AAZStrType, ".provisioning_state") - _elements.set_prop("service", AAZStrType, ".service") - - locations = _builder.get(".properties.serviceEndpoints[].locations") - if locations is not None: - locations.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_wait.py deleted file mode 100644 index d674a192447..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet/subnet/_wait.py +++ /dev/null @@ -1,948 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The subnet name.", - required=True, - id_part="child_name_1", - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SubnetsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class SubnetsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_subnet_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_nat_rule = AAZObjectType( - serialized_name="outboundNatRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_nat_rule) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - - _element = _schema_network_security_group_read.properties.network_interfaces.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties.network_interfaces.Element.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_security_group_read.properties.network_interfaces.Element.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - ip_configurations = _schema_network_security_group_read.properties.network_interfaces.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tags = _schema_network_security_group_read.properties.network_interfaces.Element.tags - tags.Element = AAZStrType() - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/__cmd_group.py deleted file mode 100644 index 06369b9d587..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet-gateway", -) -class __CMDGroup(AAZCommandGroup): - """Use an Azure Virtual Network Gateway to establish secure, cross-premises connectivity. - - To learn more about Azure Virtual Network Gateways, visit https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-cli. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/__init__.py deleted file mode 100644 index a7bf2b4140b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._list_advertised_routes import * -from ._list_bgp_peer_status import * -from ._list_learned_routes import * -from ._reset import * -from ._show import * -from ._show_supported_devices import * -from ._update import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_create.py deleted file mode 100644 index 86d09ed9b28..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_create.py +++ /dev/null @@ -1,640 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway create", -) -class Create(AAZCommand): - """Create a virtual network gateway. - - :example: Create a basic virtual network gateway for site-to-site connectivity. - az network vnet-gateway create -g MyResourceGroup -n MyVnetGateway --public-ip-address MyGatewayIp --vnet MyVnet --gateway-type Vpn --sku VpnGw1 --vpn-type RouteBased --no-wait - - :example: Create a basic virtual network gateway that provides point-to-site connectivity with a RADIUS secret that matches what is configured on a RADIUS server. - az network vnet-gateway create -g MyResourceGroup -n MyVnetGateway --public-ip-address MyGatewayIp --vnet MyVnet --gateway-type Vpn --sku VpnGw1 --vpn-type RouteBased --address-prefixes 40.1.0.0/24 --client-protocol IkeV2 SSTP --radius-secret 111_aaa --radius-server 30.1.1.15 --vpn-gateway-generation Generation1 - - :example: Create a basic virtual network gateway with multi authentication - az network vnet-gateway create -g MyResourceGroup -n MyVnetGateway --public-ip-address MyGatewayIp --vnet MyVnet --gateway-type Vpn --sku VpnGw1 --vpn-type RouteBased --address-prefixes 40.1.0.0/24 --client-protocol OpenVPN --radius-secret 111_aaa --radius-server 30.1.1.15 --aad-issuer https://sts.windows.net/00000-000000-00000-0000-000/ --aad-tenant https://login.microsoftonline.com/000 --aad-audience 0000-000 --root-cert-name root-cert --root-cert-data "root-cert.cer" --vpn-auth-type AAD Certificate Radius - - :example: Create a virtual network gateway. - az network vnet-gateway create --gateway-type Vpn --location westus2 --name MyVnetGateway --no-wait --public-ip-addresses myVGPublicIPAddress --resource-group MyResourceGroup --sku Basic --vnet MyVnet --vpn-type PolicyBased - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.gateway_default_site = AAZStrArg( - options=["--gateway-default-site"], - help="Name or ID of a local network gateway representing a local network site with default routes.", - ) - _args_schema.gateway_type = AAZStrArg( - options=["--gateway-type"], - help="The gateway type.", - default="Vpn", - enum={"ExpressRoute": "ExpressRoute", "Vpn": "Vpn"}, - ) - _args_schema.ip_configurations = AAZListArg( - options=["--ip-configurations"], - help="IP configurations for virtual network gateway.", - ) - _args_schema.sku = AAZStrArg( - options=["--sku"], - help="VNet gateway SKU.", - default="Basic", - enum={"Basic": "Basic", "HighPerformance": "HighPerformance", "Standard": "Standard", "UltraPerformance": "UltraPerformance", "VpnGw1": "VpnGw1", "VpnGw2": "VpnGw2", "VpnGw3": "VpnGw3"}, - ) - _args_schema.vpn_type = AAZStrArg( - options=["--vpn-type"], - help="VPN routing type.", - default="RouteBased", - enum={"PolicyBased": "PolicyBased", "RouteBased": "RouteBased"}, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", - ) - - ip_configurations = cls._args_schema.ip_configurations - ip_configurations.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP address allocation method.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.public_ip_address = AAZStrArg( - options=["public-ip-address"], - help="The reference to the public IP resource.", - ) - _element.subnet = AAZStrArg( - options=["subnet"], - help="test", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "BGP Peering" - - _args_schema = cls._args_schema - _args_schema.asn = AAZIntArg( - options=["--asn"], - arg_group="BGP Peering", - help="Autonomous System Number to use for the BGP settings.", - ) - _args_schema.bgp_peering_address = AAZStrArg( - options=["--bgp-peering-address"], - arg_group="BGP Peering", - help="IP address to use for BGP peering.", - ) - _args_schema.peer_weight = AAZIntArg( - options=["--peer-weight"], - arg_group="BGP Peering", - help="Weight (0-100) added to routes learned through BGP peering.", - ) - _args_schema.enable_bgp = AAZBoolArg( - options=["--enable-bgp"], - arg_group="BGP Peering", - help="Enable BGP (Border Gateway Protocol).", - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.active = AAZBoolArg( - options=["--active"], - arg_group="Properties", - help="ActiveActive flag.", - ) - _args_schema.sku_tier = AAZStrArg( - options=["--sku-tier"], - arg_group="Properties", - help="Gateway SKU tier.", - enum={"Basic": "Basic", "HighPerformance": "HighPerformance", "Standard": "Standard", "UltraPerformance": "UltraPerformance", "VpnGw1": "VpnGw1", "VpnGw2": "VpnGw2", "VpnGw3": "VpnGw3"}, - ) - - # define Arg Group "Root Cert Authentication" - - _args_schema = cls._args_schema - _args_schema.vpn_client_root_certificates = AAZListArg( - options=["--vpn-client-root-certificates"], - arg_group="Root Cert Authentication", - help="VpnClientRootCertificate for virtual network gateway.", - ) - - vpn_client_root_certificates = cls._args_schema.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectArg() - - _element = cls._args_schema.vpn_client_root_certificates.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.public_cert_data = AAZStrArg( - options=["public-cert-data"], - help="The certificate public data.", - required=True, - ) - - # define Arg Group "Sku" - - # define Arg Group "VPN Client" - - _args_schema = cls._args_schema - _args_schema.radius_server = AAZStrArg( - options=["--radius-server"], - arg_group="VPN Client", - help="Radius server address to connect to.", - ) - _args_schema.radius_secret = AAZStrArg( - options=["--radius-secret"], - arg_group="VPN Client", - help="Radius secret to use for authentication.", - ) - _args_schema.address_prefixes = AAZListArg( - options=["--address-prefixes"], - singular_options=["--address-prefix"], - arg_group="VPN Client", - help="Space-separated list of CIDR prefixes representing the address space for the P2S Vpnclient.", - ) - _args_schema.client_protocol = AAZListArg( - options=["--client-protocol"], - arg_group="VPN Client", - help="Protocols to use for connecting. Allowed values: IkeV2, OpenVPN, SSTP.", - ) - - address_prefixes = cls._args_schema.address_prefixes - address_prefixes.Element = AAZStrArg() - - client_protocol = cls._args_schema.client_protocol - client_protocol.Element = AAZStrArg( - enum={"IkeV2": "IkeV2", "SSTP": "SSTP"}, - ) - - # define Arg Group "VpnClientConfiguration" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("activeActive", AAZBoolType, ".active") - properties.set_prop("bgpSettings", AAZObjectType) - properties.set_prop("enableBgp", AAZBoolType, ".enable_bgp") - properties.set_prop("gatewayDefaultSite", AAZObjectType) - properties.set_prop("gatewayType", AAZStrType, ".gateway_type") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("sku", AAZObjectType) - properties.set_prop("vpnClientConfiguration", AAZObjectType) - properties.set_prop("vpnType", AAZStrType, ".vpn_type") - - bgp_settings = _builder.get(".properties.bgpSettings") - if bgp_settings is not None: - bgp_settings.set_prop("asn", AAZIntType, ".asn") - bgp_settings.set_prop("bgpPeeringAddress", AAZStrType, ".bgp_peering_address") - bgp_settings.set_prop("peerWeight", AAZIntType, ".peer_weight") - - gateway_default_site = _builder.get(".properties.gatewayDefaultSite") - if gateway_default_site is not None: - gateway_default_site.set_prop("id", AAZStrType, ".gateway_default_site") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType) - properties.set_prop("subnet", AAZObjectType) - - public_ip_address = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".public_ip_address") - - subnet = _builder.get(".properties.ipConfigurations[].properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - - sku = _builder.get(".properties.sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".sku") - sku.set_prop("tier", AAZStrType, ".sku_tier") - - vpn_client_configuration = _builder.get(".properties.vpnClientConfiguration") - if vpn_client_configuration is not None: - vpn_client_configuration.set_prop("radiusServerAddress", AAZStrType, ".radius_server") - vpn_client_configuration.set_prop("radiusServerSecret", AAZStrType, ".radius_secret") - vpn_client_configuration.set_prop("vpnClientAddressPool", AAZObjectType) - vpn_client_configuration.set_prop("vpnClientProtocols", AAZListType, ".client_protocol") - vpn_client_configuration.set_prop("vpnClientRootCertificates", AAZListType, ".vpn_client_root_certificates") - - vpn_client_address_pool = _builder.get(".properties.vpnClientConfiguration.vpnClientAddressPool") - if vpn_client_address_pool is not None: - vpn_client_address_pool.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".properties.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - vpn_client_protocols = _builder.get(".properties.vpnClientConfiguration.vpnClientProtocols") - if vpn_client_protocols is not None: - vpn_client_protocols.set_elements(AAZStrType, ".") - - vpn_client_root_certificates = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates") - if vpn_client_root_certificates is not None: - vpn_client_root_certificates.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - - properties = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[].properties") - if properties is not None: - properties.set_prop("publicCertData", AAZStrType, ".public_cert_data", typ_kwargs={"flags": {"required": True}}) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.location = AAZStrType() - _schema_on_200_201.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200_201.tags = AAZDictType() - _schema_on_200_201.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - _CreateHelper._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = cls._schema_on_200_201.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = cls._schema_on_200_201.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _CreateHelper._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(properties.subnet) - - sku = cls._schema_on_200_201.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = cls._schema_on_200_201.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_protocols = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = cls._schema_on_200_201.tags - tags.Element = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_delete.py deleted file mode 100644 index 910963ff2c9..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_delete.py +++ /dev/null @@ -1,164 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway delete", -) -class Delete(AAZCommand): - """Delete a virtual network gateway. - - In order to delete a Virtual Network Gateway, you must first delete ALL Connection objects in Azure that are connected to the Gateway. After deleting the Gateway, proceed to delete other resources now not in use. For more information, follow the order of instructions on this page: https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-delete-vnet-gateway-portal - - :example: Delete a virtual network gateway. - az network vnet-gateway delete -g MyResourceGroup -n MyVnetGateway - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class VirtualNetworkGatewaysDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_list.py deleted file mode 100644 index a8a013b3138..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_list.py +++ /dev/null @@ -1,340 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway list", -) -class List(AAZCommand): - """List virtual network gateways. - - :example: List virtual network gateways in a resource group. - az network vnet-gateway list -g MyResourceGroup - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class VirtualNetworkGatewaysList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - _ListHelper._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = cls._schema_on_200.value.Element.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = cls._schema_on_200.value.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _ListHelper._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(properties.subnet) - - sku = cls._schema_on_200.value.Element.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = cls._schema_on_200.value.Element.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_protocols = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_list_advertised_routes.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_list_advertised_routes.py deleted file mode 100644 index 9ac1615190f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_list_advertised_routes.py +++ /dev/null @@ -1,221 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway list-advertised-routes", -) -class ListAdvertisedRoutes(AAZCommand): - """List the routes of a virtual network gateway advertised to the specified peer. - - :example: List the routes of a virtual network gateway advertised to the specified peer. - az network vnet-gateway list-advertised-routes -g MyResourceGroup -n MyVnetGateway --peer 23.10.10.9 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/getadvertisedroutes", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - _args_schema.peer = AAZStrArg( - options=["--peer"], - help="The IP address of the peer.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysGetAdvertisedRoutes(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysGetAdvertisedRoutes(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "peer", self.ctx.args.peer, - required=True, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.as_path = AAZStrType( - serialized_name="asPath", - flags={"read_only": True}, - ) - _element.local_address = AAZStrType( - serialized_name="localAddress", - flags={"read_only": True}, - ) - _element.network = AAZStrType( - flags={"read_only": True}, - ) - _element.next_hop = AAZStrType( - serialized_name="nextHop", - flags={"read_only": True}, - ) - _element.origin = AAZStrType( - flags={"read_only": True}, - ) - _element.source_peer = AAZStrType( - serialized_name="sourcePeer", - flags={"read_only": True}, - ) - _element.weight = AAZIntType( - flags={"read_only": True}, - ) - - return cls._schema_on_200 - - -class _ListAdvertisedRoutesHelper: - """Helper class for ListAdvertisedRoutes""" - - -__all__ = ["ListAdvertisedRoutes"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_list_bgp_peer_status.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_list_bgp_peer_status.py deleted file mode 100644 index 5846cc725af..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_list_bgp_peer_status.py +++ /dev/null @@ -1,223 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway list-bgp-peer-status", -) -class ListBgpPeerStatus(AAZCommand): - """Retrieve the status of BGP peers. - - :example: Retrieve the status of a BGP peer. - az network vnet-gateway list-bgp-peer-status -g MyResourceGroup -n MyVnetGateway --peer 23.10.10.9 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/getbgppeerstatus", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - _args_schema.peer = AAZStrArg( - options=["--peer"], - help="The IP address of the peer to retrieve the status of. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysGetBgpPeerStatus(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysGetBgpPeerStatus(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "peer", self.ctx.args.peer, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.asn = AAZIntType( - flags={"read_only": True}, - ) - _element.connected_duration = AAZStrType( - serialized_name="connectedDuration", - flags={"read_only": True}, - ) - _element.local_address = AAZStrType( - serialized_name="localAddress", - flags={"read_only": True}, - ) - _element.messages_received = AAZIntType( - serialized_name="messagesReceived", - flags={"read_only": True}, - ) - _element.messages_sent = AAZIntType( - serialized_name="messagesSent", - flags={"read_only": True}, - ) - _element.neighbor = AAZStrType( - flags={"read_only": True}, - ) - _element.routes_received = AAZIntType( - serialized_name="routesReceived", - flags={"read_only": True}, - ) - _element.state = AAZStrType( - flags={"read_only": True}, - ) - - return cls._schema_on_200 - - -class _ListBgpPeerStatusHelper: - """Helper class for ListBgpPeerStatus""" - - -__all__ = ["ListBgpPeerStatus"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_list_learned_routes.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_list_learned_routes.py deleted file mode 100644 index 789b2385971..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_list_learned_routes.py +++ /dev/null @@ -1,212 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway list-learned-routes", -) -class ListLearnedRoutes(AAZCommand): - """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. - - :example: Retrieve a list of learned routes. - az network vnet-gateway list-learned-routes -g MyResourceGroup -n MyVnetGateway - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/getlearnedroutes", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysGetLearnedRoutes(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysGetLearnedRoutes(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.as_path = AAZStrType( - serialized_name="asPath", - flags={"read_only": True}, - ) - _element.local_address = AAZStrType( - serialized_name="localAddress", - flags={"read_only": True}, - ) - _element.network = AAZStrType( - flags={"read_only": True}, - ) - _element.next_hop = AAZStrType( - serialized_name="nextHop", - flags={"read_only": True}, - ) - _element.origin = AAZStrType( - flags={"read_only": True}, - ) - _element.source_peer = AAZStrType( - serialized_name="sourcePeer", - flags={"read_only": True}, - ) - _element.weight = AAZIntType( - flags={"read_only": True}, - ) - - return cls._schema_on_200 - - -class _ListLearnedRoutesHelper: - """Helper class for ListLearnedRoutes""" - - -__all__ = ["ListLearnedRoutes"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_reset.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_reset.py deleted file mode 100644 index b36ff07606a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_reset.py +++ /dev/null @@ -1,368 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway reset", -) -class Reset(AAZCommand): - """Reset a virtual network gateway. - - :example: Reset a virtual network gateway. - az network vnet-gateway reset -g MyResourceGroup -n MyVnetGateway - - :example: Reset a virtual network gateway with Active-Active feature enabled. - az network vnet-gateway reset -g MyResourceGroup -n MyVnetGateway --gateway-vip MyGatewayIP - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/reset", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - _args_schema.gateway_vip = AAZStrArg( - options=["--gateway-vip"], - help="Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway.", - default="None", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysReset(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysReset(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "gatewayVip", self.ctx.args.gateway_vip, - ), - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - _ResetHelper._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = cls._schema_on_200.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = cls._schema_on_200.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _ResetHelper._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _ResetHelper._build_schema_sub_resource_read(properties.subnet) - - sku = cls._schema_on_200.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = cls._schema_on_200.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_protocols = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ResetHelper: - """Helper class for Reset""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["Reset"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_show.py deleted file mode 100644 index af8f43b79a3..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_show.py +++ /dev/null @@ -1,340 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway show", -) -class Show(AAZCommand): - """Get the details of a virtual network gateway. - - :example: Get the details of a virtual network gateway. - az network vnet-gateway show -g MyResourceGroup -n MyVnetGateway - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - _ShowHelper._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = cls._schema_on_200.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = cls._schema_on_200.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _ShowHelper._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(properties.subnet) - - sku = cls._schema_on_200.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = cls._schema_on_200.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_protocols = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_show_supported_devices.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_show_supported_devices.py deleted file mode 100644 index e617678459e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_show_supported_devices.py +++ /dev/null @@ -1,163 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway show-supported-devices", - is_preview=True, -) -class ShowSupportedDevices(AAZCommand): - """Get a xml format representation for supported vpn devices. - - :example: Get a xml format representation for supported vpn devices. - az network vnet-gateway show-supported-devices -g MyResourceGroup -n MyVnetGateway - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/supportedvpndevices", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysSupportedVpnDevices(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysSupportedVpnDevices(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZStrType() - - return cls._schema_on_200 - - -class _ShowSupportedDevicesHelper: - """Helper class for ShowSupportedDevices""" - - -__all__ = ["ShowSupportedDevices"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_update.py deleted file mode 100644 index 73c41fec53e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_update.py +++ /dev/null @@ -1,820 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway update", -) -class Update(AAZCommand): - """Update a virtual network gateway. - - :example: Change the SKU of a virtual network gateway. - az network vnet-gateway update -g MyResourceGroup -n MyVnetGateway --sku VpnGw2 - - :example: Update a virtual network gateway. - az network vnet-gateway update --address-prefixes 40.1.0.0/24 --client-protocol IkeV2 --name MyVnetGateway --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - _args_schema.gateway_default_site = AAZStrArg( - options=["--gateway-default-site"], - help="Name or ID of a local network gateway representing a local network site with default routes.", - nullable=True, - ) - _args_schema.gateway_type = AAZStrArg( - options=["--gateway-type"], - help="The gateway type.", - nullable=True, - enum={"ExpressRoute": "ExpressRoute", "Vpn": "Vpn"}, - ) - _args_schema.sku = AAZStrArg( - options=["--sku"], - help="VNet gateway SKU.", - nullable=True, - enum={"Basic": "Basic", "HighPerformance": "HighPerformance", "Standard": "Standard", "UltraPerformance": "UltraPerformance", "VpnGw1": "VpnGw1", "VpnGw2": "VpnGw2", "VpnGw3": "VpnGw3"}, - ) - _args_schema.vpn_type = AAZStrArg( - options=["--vpn-type"], - help="VPN routing type.", - nullable=True, - enum={"PolicyBased": "PolicyBased", "RouteBased": "RouteBased"}, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "BGP Peering" - - _args_schema = cls._args_schema - _args_schema.asn = AAZIntArg( - options=["--asn"], - arg_group="BGP Peering", - help="Autonomous System Number to use for the BGP settings.", - nullable=True, - ) - _args_schema.bgp_peering_address = AAZStrArg( - options=["--bgp-peering-address"], - arg_group="BGP Peering", - help="IP address to use for BGP peering.", - nullable=True, - ) - _args_schema.peer_weight = AAZIntArg( - options=["--peer-weight"], - arg_group="BGP Peering", - help="Weight (0-100) added to routes learned through BGP peering.", - nullable=True, - ) - _args_schema.enable_bgp = AAZBoolArg( - options=["--enable-bgp"], - arg_group="BGP Peering", - help="Enable BGP (Border Gateway Protocol).", - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.active = AAZBoolArg( - options=["--active"], - arg_group="Properties", - help="ActiveActive flag.", - nullable=True, - ) - _args_schema.ip_configurations = AAZListArg( - options=["--ip-configurations"], - arg_group="Properties", - help="IP configurations for virtual network gateway.", - nullable=True, - ) - _args_schema.sku_tier = AAZStrArg( - options=["--sku-tier"], - arg_group="Properties", - help="Gateway SKU tier.", - nullable=True, - enum={"Basic": "Basic", "HighPerformance": "HighPerformance", "Standard": "Standard", "UltraPerformance": "UltraPerformance", "VpnGw1": "VpnGw1", "VpnGw2": "VpnGw2", "VpnGw3": "VpnGw3"}, - ) - - ip_configurations = cls._args_schema.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP address allocation method.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference to the public IP resource.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.public_ip_address) - _element.subnet = AAZStrArg( - options=["subnet"], - help="test", - nullable=True, - ) - - # define Arg Group "Root Cert Authentication" - - _args_schema = cls._args_schema - _args_schema.vpn_client_root_certificates = AAZListArg( - options=["--vpn-client-root-certificates"], - arg_group="Root Cert Authentication", - help="VpnClientRootCertificate for virtual network gateway.", - nullable=True, - ) - - vpn_client_root_certificates = cls._args_schema.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.vpn_client_root_certificates.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.public_cert_data = AAZStrArg( - options=["public-cert-data"], - help="The certificate public data.", - ) - - # define Arg Group "Sku" - - # define Arg Group "VPN Client" - - _args_schema = cls._args_schema - _args_schema.radius_server = AAZStrArg( - options=["--radius-server"], - arg_group="VPN Client", - help="Radius server address to connect to.", - nullable=True, - ) - _args_schema.radius_secret = AAZStrArg( - options=["--radius-secret"], - arg_group="VPN Client", - help="Radius secret to use for authentication.", - nullable=True, - ) - _args_schema.address_prefixes = AAZListArg( - options=["--address-prefixes"], - singular_options=["--address-prefix"], - arg_group="VPN Client", - help="Space-separated list of CIDR prefixes representing the address space for the P2S Vpnclient.", - nullable=True, - ) - _args_schema.client_protocol = AAZListArg( - options=["--client-protocol"], - arg_group="VPN Client", - help="Protocols to use for connecting. Allowed values: IkeV2, OpenVPN, SSTP.", - nullable=True, - ) - - address_prefixes = cls._args_schema.address_prefixes - address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - client_protocol = cls._args_schema.client_protocol - client_protocol.Element = AAZStrArg( - nullable=True, - enum={"IkeV2": "IkeV2", "SSTP": "SSTP"}, - ) - - # define Arg Group "VpnClientConfiguration" - return cls._args_schema - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("activeActive", AAZBoolType, ".active") - properties.set_prop("bgpSettings", AAZObjectType) - properties.set_prop("enableBgp", AAZBoolType, ".enable_bgp") - properties.set_prop("gatewayDefaultSite", AAZObjectType) - properties.set_prop("gatewayType", AAZStrType, ".gateway_type") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("sku", AAZObjectType) - properties.set_prop("vpnClientConfiguration", AAZObjectType) - properties.set_prop("vpnType", AAZStrType, ".vpn_type") - - bgp_settings = _builder.get(".properties.bgpSettings") - if bgp_settings is not None: - bgp_settings.set_prop("asn", AAZIntType, ".asn") - bgp_settings.set_prop("bgpPeeringAddress", AAZStrType, ".bgp_peering_address") - bgp_settings.set_prop("peerWeight", AAZIntType, ".peer_weight") - - gateway_default_site = _builder.get(".properties.gatewayDefaultSite") - if gateway_default_site is not None: - gateway_default_site.set_prop("id", AAZStrType, ".gateway_default_site") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - _UpdateHelper._build_schema_sub_resource_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - properties.set_prop("subnet", AAZObjectType) - - subnet = _builder.get(".properties.ipConfigurations[].properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - - sku = _builder.get(".properties.sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".sku") - sku.set_prop("tier", AAZStrType, ".sku_tier") - - vpn_client_configuration = _builder.get(".properties.vpnClientConfiguration") - if vpn_client_configuration is not None: - vpn_client_configuration.set_prop("radiusServerAddress", AAZStrType, ".radius_server") - vpn_client_configuration.set_prop("radiusServerSecret", AAZStrType, ".radius_secret") - vpn_client_configuration.set_prop("vpnClientAddressPool", AAZObjectType) - vpn_client_configuration.set_prop("vpnClientProtocols", AAZListType, ".client_protocol") - vpn_client_configuration.set_prop("vpnClientRootCertificates", AAZListType, ".vpn_client_root_certificates") - - vpn_client_address_pool = _builder.get(".properties.vpnClientConfiguration.vpnClientAddressPool") - if vpn_client_address_pool is not None: - vpn_client_address_pool.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".properties.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - vpn_client_protocols = _builder.get(".properties.vpnClientConfiguration.vpnClientProtocols") - if vpn_client_protocols is not None: - vpn_client_protocols.set_elements(AAZStrType, ".") - - vpn_client_root_certificates = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates") - if vpn_client_root_certificates is not None: - vpn_client_root_certificates.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - - properties = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[].properties") - if properties is not None: - properties.set_prop("publicCertData", AAZStrType, ".public_cert_data", typ_kwargs={"flags": {"required": True}}) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_wait.py deleted file mode 100644 index dc0dcc0908e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/_wait.py +++ /dev/null @@ -1,336 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - _WaitHelper._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = cls._schema_on_200.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = cls._schema_on_200.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _WaitHelper._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(properties.subnet) - - sku = cls._schema_on_200.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = cls._schema_on_200.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_protocols = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/revoked_cert/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/revoked_cert/__cmd_group.py deleted file mode 100644 index ca7e7a8061f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/revoked_cert/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet-gateway revoked-cert", -) -class __CMDGroup(AAZCommandGroup): - """Manage revoked certificates in a virtual network gateway. Prevent machines using this certificate from accessing Azure through this gateway. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/revoked_cert/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/revoked_cert/__init__.py deleted file mode 100644 index cf0f7e303bd..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/revoked_cert/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/revoked_cert/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/revoked_cert/_create.py deleted file mode 100644 index 6f051fa3c55..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/revoked_cert/_create.py +++ /dev/null @@ -1,544 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway revoked-cert create", -) -class Create(AAZCommand): - """Revoke a certificate. - - :example: Revoke a certificate. - az network vnet-gateway revoked-cert create -g MyResourceGroup -n MyRootCertificate --gateway-name MyVnetGateway --thumbprint abc123 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2017-10-01", "properties.vpnClientConfiguration.vpnClientRevokedCertificates[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Root certificate name.", - required=True, - ) - _args_schema.thumbprint = AAZStrArg( - options=["--thumbprint"], - help="Certificate thumbprint.", - ) - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRevokedCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRevokedCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("thumbprint", AAZStrType, ".thumbprint") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/revoked_cert/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/revoked_cert/_delete.py deleted file mode 100644 index 6a14bea0674..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/revoked_cert/_delete.py +++ /dev/null @@ -1,523 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway revoked-cert delete", -) -class Delete(AAZCommand): - """Delete a revoked certificate. - - :example: Delete a revoked certificate. - az network vnet-gateway revoked-cert delete -g MyResourceGroup -n MyRootCertificate --gateway-name MyVnetGateway - - :example: Delete a revoked certificate. - az network vnet-gateway revoked-cert delete --gateway-name MyVnetGateway --name MyRootCertificate --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2017-10-01", "properties.vpnClientConfiguration.vpnClientRevokedCertificates[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Root certificate name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRevokedCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRevokedCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/revoked_cert/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/revoked_cert/_wait.py deleted file mode 100644 index fc0a10e6840..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/revoked_cert/_wait.py +++ /dev/null @@ -1,361 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway revoked-cert wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2017-10-01", "properties.vpnClientConfiguration.vpnClientRevokedCertificates[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/root_cert/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/root_cert/__cmd_group.py deleted file mode 100644 index c69c7128a05..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/root_cert/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet-gateway root-cert", -) -class __CMDGroup(AAZCommandGroup): - """Manage root certificates of a virtual network gateway. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/root_cert/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/root_cert/__init__.py deleted file mode 100644 index cf0f7e303bd..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/root_cert/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/root_cert/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/root_cert/_create.py deleted file mode 100644 index 0225884df59..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/root_cert/_create.py +++ /dev/null @@ -1,545 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway root-cert create", -) -class Create(AAZCommand): - """Upload a root certificate. - - :example: Add a Root Certificate to the list of certs allowed to connect to this Gateway. - az network vnet-gateway root-cert create -g MyResourceGroup -n MyRootCertificate --gateway-name MyVnetGateway --public-cert-data MyCertificateData - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2017-10-01", "properties.vpnClientConfiguration.vpnClientRootCertificates[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Root certificate name.", - required=True, - ) - _args_schema.root_cert_data = AAZStrArg( - options=["--root-cert-data"], - help="Base64 contents of the root certificate file or file path.", - required=True, - ) - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRootCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRootCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("publicCertData", AAZStrType, ".root_cert_data", typ_kwargs={"flags": {"required": True}}) - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/root_cert/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/root_cert/_delete.py deleted file mode 100644 index 5c89dcc78fb..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/root_cert/_delete.py +++ /dev/null @@ -1,523 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway root-cert delete", -) -class Delete(AAZCommand): - """Delete a root certificate. - - :example: Remove a certificate from the list of Root Certificates whose children are allowed to access this Gateway. - az network vnet-gateway root-cert delete -g MyResourceGroup -n MyRootCertificate --gateway-name MyVnetGateway - - :example: Delete a root certificate. - az network vnet-gateway root-cert delete --gateway-name MyVnetGateway --name MyRootCertificate --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2017-10-01", "properties.vpnClientConfiguration.vpnClientRootCertificates[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Root certificate name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRootCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRootCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/root_cert/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/root_cert/_wait.py deleted file mode 100644 index d511846c8fb..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/root_cert/_wait.py +++ /dev/null @@ -1,361 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway root-cert wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2017-10-01", "properties.vpnClientConfiguration.vpnClientRootCertificates[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/vpn_client/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/vpn_client/__cmd_group.py deleted file mode 100644 index 91bef18b63a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/vpn_client/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet-gateway vpn-client", -) -class __CMDGroup(AAZCommandGroup): - """Download a VPN client configuration required to connect to Azure via point-to-site. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/vpn_client/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/vpn_client/__init__.py deleted file mode 100644 index c53ec198366..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/vpn_client/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._generate import * -from ._generate_vpn_profile import * -from ._show_url import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/vpn_client/_generate.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/vpn_client/_generate.py deleted file mode 100644 index 109c5267182..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/vpn_client/_generate.py +++ /dev/null @@ -1,232 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Generate(AAZCommand): - """Generate VPN client configuration. - - :example: Create the VPN client configuration for RADIUS with EAP-MSCHAV2 authentication. - az network vnet-gateway vpn-client generate -g MyResourceGroup -n MyVnetGateway --authentication-method EAPMSCHAPv2 - - :example: Create the VPN client configuration for AMD64 architecture. - az network vnet-gateway vpn-client generate -g MyResourceGroup -n MyVnetGateway --processor-architecture Amd64 - - :example: Generate VPN client configuration. - az network vnet-gateway vpn-client generate --name MyVnetGateway --processor-architecture Amd64 --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/generatevpnclientpackage", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.authentication_method = AAZStrArg( - options=["--authentication-method"], - arg_group="Parameters", - help="Method used to authenticate with the generated client.", - enum={"EAPMSCHAPv2": "EAPMSCHAPv2", "EAPTLS": "EAPTLS"}, - ) - _args_schema.client_root_certificates = AAZListArg( - options=["--client-root-certificates"], - arg_group="Parameters", - help="Space-separated list of client root certificate public certificate data in Base-64 format. Optional for external Radius-based auth with EAPTLS.", - ) - _args_schema.processor_architecture = AAZStrArg( - options=["--processor-architecture"], - arg_group="Parameters", - help="Processor architecture of the target system.", - enum={"Amd64": "Amd64", "X86": "X86"}, - ) - _args_schema.radius_server_auth_certificate = AAZStrArg( - options=["--radius-server-auth-certificate"], - arg_group="Parameters", - help="Public certificate data for the Radius server auth certificate in Base-64 format. Required only if external Radius auth has been configured with EAPTLS auth.", - ) - - client_root_certificates = cls._args_schema.client_root_certificates - client_root_certificates.Element = AAZStrArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysGeneratevpnclientpackage(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGeneratevpnclientpackage(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("authenticationMethod", AAZStrType, ".authentication_method") - _builder.set_prop("clientRootCertificates", AAZListType, ".client_root_certificates") - _builder.set_prop("processorArchitecture", AAZStrType, ".processor_architecture") - _builder.set_prop("radiusServerAuthCertificate", AAZStrType, ".radius_server_auth_certificate") - - client_root_certificates = _builder.get(".clientRootCertificates") - if client_root_certificates is not None: - client_root_certificates.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZStrType() - - return cls._schema_on_200 - - -class _GenerateHelper: - """Helper class for Generate""" - - -__all__ = ["Generate"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/vpn_client/_generate_vpn_profile.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/vpn_client/_generate_vpn_profile.py deleted file mode 100644 index 3130df867eb..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/vpn_client/_generate_vpn_profile.py +++ /dev/null @@ -1,223 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class GenerateVpnProfile(AAZCommand): - """Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/generatevpnprofile", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.authentication_method = AAZStrArg( - options=["--authentication-method"], - arg_group="Parameters", - help="VPN client authentication method.", - enum={"EAPMSCHAPv2": "EAPMSCHAPv2", "EAPTLS": "EAPTLS"}, - ) - _args_schema.client_root_certificates = AAZListArg( - options=["--client-root-certificates"], - arg_group="Parameters", - help="A list of client root certificates public certificate data encoded as Base-64 strings. Optional parameter for external radius based authentication with EAPTLS.", - ) - _args_schema.processor_architecture = AAZStrArg( - options=["--processor-architecture"], - arg_group="Parameters", - help="VPN client Processor Architecture.", - enum={"Amd64": "Amd64", "X86": "X86"}, - ) - _args_schema.radius_server_auth_certificate = AAZStrArg( - options=["--radius-server-auth-certificate"], - arg_group="Parameters", - help="The public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with EAPTLS authentication.", - ) - - client_root_certificates = cls._args_schema.client_root_certificates - client_root_certificates.Element = AAZStrArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysGenerateVpnProfile(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGenerateVpnProfile(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("authenticationMethod", AAZStrType, ".authentication_method") - _builder.set_prop("clientRootCertificates", AAZListType, ".client_root_certificates") - _builder.set_prop("processorArchitecture", AAZStrType, ".processor_architecture") - _builder.set_prop("radiusServerAuthCertificate", AAZStrType, ".radius_server_auth_certificate") - - client_root_certificates = _builder.get(".clientRootCertificates") - if client_root_certificates is not None: - client_root_certificates.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZStrType() - - return cls._schema_on_200 - - -class _GenerateVpnProfileHelper: - """Helper class for GenerateVpnProfile""" - - -__all__ = ["GenerateVpnProfile"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/vpn_client/_show_url.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/vpn_client/_show_url.py deleted file mode 100644 index f6a5870f62f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vnet_gateway/vpn_client/_show_url.py +++ /dev/null @@ -1,179 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway vpn-client show-url", -) -class ShowUrl(AAZCommand): - """Retrieve a pre-generated VPN client configuration. - - :example: Get the pre-generated point-to-site VPN client of the virtual network gateway. - az network vnet-gateway vpn-client show-url -g MyResourceGroup -n MyVnetGateway - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/getvpnprofilepackageurl", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysGetVpnProfilePackageUrl(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGetVpnProfilePackageUrl(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZStrType() - - return cls._schema_on_200 - - -class _ShowUrlHelper: - """Helper class for ShowUrl""" - - -__all__ = ["ShowUrl"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/__cmd_group.py deleted file mode 100644 index 7668b41df2f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vpn-connection", -) -class __CMDGroup(AAZCommandGroup): - """Manage VPN connections. - - For more information on site-to-site connections, visit https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-cli. For more information on Vnet-to-Vnet connections, visit https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-vnet-vnet-cli. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/__init__.py deleted file mode 100644 index 6acd4543b6e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._delete import * -from ._list import * -from ._list_connection import * -from ._show import * -from ._show_device_config_script import * -from ._update import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_delete.py deleted file mode 100644 index 2e457bf5da4..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection delete", -) -class Delete(AAZCommand): - """Delete a VPN connection. - - :example: Delete a VPN connection. - az network vpn-connection delete -g MyResourceGroup -n MyConnection - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Connection name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewayConnectionsDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class VirtualNetworkGatewayConnectionsDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_list.py deleted file mode 100644 index 78524867602..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_list.py +++ /dev/null @@ -1,569 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class List(AAZCommand): - """List all VPN connections. - - :example: List all VPN connections in a resource group. - az network vpn-connection list -g MyResourceGroup - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class VirtualNetworkGatewayConnectionsList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - _ListHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - _ListHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - ipsec_policies = cls._schema_on_200.value.Element.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - local_network_gateway2 = cls._schema_on_200.value.Element.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - _ListHelper._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - _ListHelper._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = cls._schema_on_200.value.Element.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tunnel_connection_status = cls._schema_on_200.value.Element.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_list_connection.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_list_connection.py deleted file mode 100644 index 48913a6896b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_list_connection.py +++ /dev/null @@ -1,325 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class ListConnection(AAZCommand): - """List all the connections in a virtual network gateway. - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/connections", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_gateway = AAZStrArg( - options=["--vnet-gateway"], - help="Name of the VNet gateway.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysListConnections(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class VirtualNetworkGatewaysListConnections(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.vnet_gateway, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - _ListConnectionHelper._build_schema_virtual_network_connection_gateway_reference_read(properties.local_network_gateway2) - properties.peer = AAZObjectType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - _ListConnectionHelper._build_schema_virtual_network_connection_gateway_reference_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - _ListConnectionHelper._build_schema_virtual_network_connection_gateway_reference_read(properties.virtual_network_gateway2) - - ipsec_policies = cls._schema_on_200.value.Element.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - peer = cls._schema_on_200.value.Element.properties.peer - peer.id = AAZStrType() - - tunnel_connection_status = cls._schema_on_200.value.Element.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListConnectionHelper: - """Helper class for ListConnection""" - - _schema_virtual_network_connection_gateway_reference_read = None - - @classmethod - def _build_schema_virtual_network_connection_gateway_reference_read(cls, _schema): - if cls._schema_virtual_network_connection_gateway_reference_read is not None: - _schema.id = cls._schema_virtual_network_connection_gateway_reference_read.id - return - - cls._schema_virtual_network_connection_gateway_reference_read = _schema_virtual_network_connection_gateway_reference_read = AAZObjectType() - - virtual_network_connection_gateway_reference_read = _schema_virtual_network_connection_gateway_reference_read - virtual_network_connection_gateway_reference_read.id = AAZStrType( - flags={"required": True}, - ) - - _schema.id = cls._schema_virtual_network_connection_gateway_reference_read.id - - -__all__ = ["ListConnection"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_show.py deleted file mode 100644 index 8f167a89438..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_show.py +++ /dev/null @@ -1,572 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection show", -) -class Show(AAZCommand): - """Get the details of a VPN connection. - - :example: View the details of a VPN connection. - az network vpn-connection show -g MyResourceGroup -n MyConnection - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Connection name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewayConnectionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - _ShowHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - _ShowHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - ipsec_policies = cls._schema_on_200.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - local_network_gateway2 = cls._schema_on_200.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - _ShowHelper._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - _ShowHelper._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = cls._schema_on_200.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tunnel_connection_status = cls._schema_on_200.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_show_device_config_script.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_show_device_config_script.py deleted file mode 100644 index 2254998e9dd..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_show_device_config_script.py +++ /dev/null @@ -1,191 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection show-device-config-script", - is_preview=True, -) -class ShowDeviceConfigScript(AAZCommand): - """Get a XML format representation for VPN connection device configuration script. - - :example: Get a XML format representation for VPN connection device configuration script. - az network vpn-connection show-device-config-script -g MyResourceGroup -n MyConnection --vendor "Cisco" --device-family "Cisco-ISR(IOS)" --firmware-version "Cisco-ISR-15.x-- IKEv2+BGP" - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}/vpndeviceconfigurationscript", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Connection name.", - required=True, - id_part="name", - ) - _args_schema.device_family = AAZStrArg( - options=["--device-family"], - help="The device family for the vpn device.", - ) - _args_schema.firmware_version = AAZStrArg( - options=["--firmware-version"], - help="The firmware version for the vpn device.", - ) - _args_schema.vendor = AAZStrArg( - options=["--vendor"], - help="The vendor for the vpn device.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysVpnDeviceConfigurationScript(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysVpnDeviceConfigurationScript(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("deviceFamily", AAZStrType, ".device_family") - _builder.set_prop("firmwareVersion", AAZStrType, ".firmware_version") - _builder.set_prop("vendor", AAZStrType, ".vendor") - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZStrType() - - return cls._schema_on_200 - - -class _ShowDeviceConfigScriptHelper: - """Helper class for ShowDeviceConfigScript""" - - -__all__ = ["ShowDeviceConfigScript"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_update.py deleted file mode 100644 index d7253a27acd..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_update.py +++ /dev/null @@ -1,1329 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection update", -) -class Update(AAZCommand): - """Update a VPN connection. - - :example: Add BGP to an existing connection. - az network vpn-connection update -g MyResourceGroup -n MyConnection --enable-bgp True - - :example: Update a VPN connection. - az network vpn-connection update --name MyConnection --resource-group MyResourceGroup --use-policy-based-traffic-selectors true - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Connection name.", - required=True, - id_part="name", - ) - _args_schema.enable_bgp = AAZBoolArg( - options=["--enable-bgp"], - help="Enable BGP (Border Gateway Protocol).", - nullable=True, - ) - _args_schema.routing_weight = AAZIntArg( - options=["--routing-weight"], - help="Connection routing weight.", - nullable=True, - ) - _args_schema.shared_key = AAZStrArg( - options=["--shared-key"], - help="Shared IPSec key.", - nullable=True, - ) - _args_schema.use_policy_based_traffic_selectors = AAZBoolArg( - options=["--use-policy-based-traffic-selectors"], - help="Enable policy-based traffic selectors.", - nullable=True, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.ipsec_policies = AAZListArg( - options=["--ipsec-policies"], - arg_group="Properties", - help="The IPSec Policies to be considered by this connection.", - nullable=True, - ) - - ipsec_policies = cls._args_schema.ipsec_policies - ipsec_policies.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.ipsec_policies.Element - _element.dh_group = AAZStrArg( - options=["dh-group"], - help="The DH Groups used in IKE Phase 1 for initial SA.", - enum={"DHGroup1": "DHGroup1", "DHGroup14": "DHGroup14", "DHGroup2": "DHGroup2", "DHGroup2048": "DHGroup2048", "DHGroup24": "DHGroup24", "ECP256": "ECP256", "ECP384": "ECP384", "None": "None"}, - ) - _element.ike_encryption = AAZStrArg( - options=["ike-encryption"], - help="The IKE encryption algorithm (IKE phase 2).", - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3"}, - ) - _element.ike_integrity = AAZStrArg( - options=["ike-integrity"], - help="The IKE integrity algorithm (IKE phase 2).", - enum={"MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256", "SHA384": "SHA384"}, - ) - _element.ipsec_encryption = AAZStrArg( - options=["ipsec-encryption"], - help="The IPSec encryption algorithm (IKE phase 1).", - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3", "GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "None": "None"}, - ) - _element.ipsec_integrity = AAZStrArg( - options=["ipsec-integrity"], - help="The IPSec integrity algorithm (IKE phase 1).", - enum={"GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256"}, - ) - _element.pfs_group = AAZStrArg( - options=["pfs-group"], - help="The Pfs Groups used in IKE Phase 2 for new child SA.", - enum={"ECP256": "ECP256", "ECP384": "ECP384", "None": "None", "PFS1": "PFS1", "PFS2": "PFS2", "PFS2048": "PFS2048", "PFS24": "PFS24"}, - ) - _element.sa_data_size_kilobytes = AAZIntArg( - options=["sa-data-size-kilobytes"], - help="The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel.", - ) - _element.sa_life_time_seconds = AAZIntArg( - options=["sa-life-time-seconds"], - help="The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel.", - ) - return cls._args_schema - - _args_address_space_update = None - - @classmethod - def _build_args_address_space_update(cls, _schema): - if cls._args_address_space_update is not None: - _schema.address_prefixes = cls._args_address_space_update.address_prefixes - return - - cls._args_address_space_update = AAZObjectArg( - nullable=True, - ) - - address_space_update = cls._args_address_space_update - address_space_update.address_prefixes = AAZListArg( - options=["address-prefixes"], - help="A list of address blocks reserved for this virtual network in CIDR notation.", - nullable=True, - ) - - address_prefixes = cls._args_address_space_update.address_prefixes - address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - _schema.address_prefixes = cls._args_address_space_update.address_prefixes - - _args_bgp_settings_update = None - - @classmethod - def _build_args_bgp_settings_update(cls, _schema): - if cls._args_bgp_settings_update is not None: - _schema.asn = cls._args_bgp_settings_update.asn - _schema.bgp_peering_address = cls._args_bgp_settings_update.bgp_peering_address - _schema.peer_weight = cls._args_bgp_settings_update.peer_weight - return - - cls._args_bgp_settings_update = AAZObjectArg( - nullable=True, - ) - - bgp_settings_update = cls._args_bgp_settings_update - bgp_settings_update.asn = AAZIntArg( - options=["asn"], - help="The BGP speaker's ASN.", - nullable=True, - ) - bgp_settings_update.bgp_peering_address = AAZStrArg( - options=["bgp-peering-address"], - help="The BGP peering address and BGP identifier of this BGP speaker.", - nullable=True, - ) - bgp_settings_update.peer_weight = AAZIntArg( - options=["peer-weight"], - help="The weight added to routes learned from this BGP speaker.", - nullable=True, - ) - - _schema.asn = cls._args_bgp_settings_update.asn - _schema.bgp_peering_address = cls._args_bgp_settings_update.bgp_peering_address - _schema.peer_weight = cls._args_bgp_settings_update.peer_weight - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_virtual_network_gateway_update = None - - @classmethod - def _build_args_virtual_network_gateway_update(cls, _schema): - if cls._args_virtual_network_gateway_update is not None: - _schema.active_active = cls._args_virtual_network_gateway_update.active_active - _schema.bgp_settings = cls._args_virtual_network_gateway_update.bgp_settings - _schema.enable_bgp = cls._args_virtual_network_gateway_update.enable_bgp - _schema.etag = cls._args_virtual_network_gateway_update.etag - _schema.gateway_default_site = cls._args_virtual_network_gateway_update.gateway_default_site - _schema.gateway_type = cls._args_virtual_network_gateway_update.gateway_type - _schema.ip_configurations = cls._args_virtual_network_gateway_update.ip_configurations - _schema.location = cls._args_virtual_network_gateway_update.location - _schema.resource_guid = cls._args_virtual_network_gateway_update.resource_guid - _schema.sku = cls._args_virtual_network_gateway_update.sku - _schema.tags = cls._args_virtual_network_gateway_update.tags - _schema.vpn_client_configuration = cls._args_virtual_network_gateway_update.vpn_client_configuration - _schema.vpn_type = cls._args_virtual_network_gateway_update.vpn_type - return - - cls._args_virtual_network_gateway_update = AAZObjectArg() - - virtual_network_gateway_update = cls._args_virtual_network_gateway_update - virtual_network_gateway_update.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - virtual_network_gateway_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - virtual_network_gateway_update.active_active = AAZBoolArg( - options=["active-active"], - help="ActiveActive flag.", - nullable=True, - ) - virtual_network_gateway_update.bgp_settings = AAZObjectArg( - options=["bgp-settings"], - help="Virtual network gateway's BGP speaker settings.", - nullable=True, - ) - cls._build_args_bgp_settings_update(virtual_network_gateway_update.bgp_settings) - virtual_network_gateway_update.enable_bgp = AAZBoolArg( - options=["enable-bgp"], - help="Whether BGP is enabled for this virtual network gateway or not.", - nullable=True, - ) - virtual_network_gateway_update.gateway_default_site = AAZObjectArg( - options=["gateway-default-site"], - help="The reference to the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting.", - nullable=True, - ) - cls._build_args_sub_resource_update(virtual_network_gateway_update.gateway_default_site) - virtual_network_gateway_update.gateway_type = AAZStrArg( - options=["gateway-type"], - help="The type of this virtual network gateway.", - nullable=True, - enum={"ExpressRoute": "ExpressRoute", "Vpn": "Vpn"}, - ) - virtual_network_gateway_update.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="IP configurations for virtual network gateway.", - nullable=True, - ) - virtual_network_gateway_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the VirtualNetworkGateway resource.", - nullable=True, - ) - virtual_network_gateway_update.sku = AAZObjectArg( - options=["sku"], - help="The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway.", - nullable=True, - ) - virtual_network_gateway_update.vpn_client_configuration = AAZObjectArg( - options=["vpn-client-configuration"], - help="The reference to the VpnClientConfiguration resource which represents the P2S VpnClient configurations.", - nullable=True, - ) - virtual_network_gateway_update.vpn_type = AAZStrArg( - options=["vpn-type"], - help="The type of this virtual network gateway.", - nullable=True, - enum={"PolicyBased": "PolicyBased", "RouteBased": "RouteBased"}, - ) - virtual_network_gateway_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - ip_configurations = cls._args_virtual_network_gateway_update.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_virtual_network_gateway_update.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP address allocation method.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference to the public IP resource.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.public_ip_address) - _element.subnet = AAZObjectArg( - options=["subnet"], - help="The reference to the subnet resource.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.subnet) - - sku = cls._args_virtual_network_gateway_update.sku - sku.capacity = AAZIntArg( - options=["capacity"], - help="The capacity.", - nullable=True, - ) - sku.name = AAZStrArg( - options=["name"], - help="Gateway SKU name.", - nullable=True, - enum={"Basic": "Basic", "HighPerformance": "HighPerformance", "Standard": "Standard", "UltraPerformance": "UltraPerformance", "VpnGw1": "VpnGw1", "VpnGw2": "VpnGw2", "VpnGw3": "VpnGw3"}, - ) - sku.tier = AAZStrArg( - options=["tier"], - help="Gateway SKU tier.", - nullable=True, - enum={"Basic": "Basic", "HighPerformance": "HighPerformance", "Standard": "Standard", "UltraPerformance": "UltraPerformance", "VpnGw1": "VpnGw1", "VpnGw2": "VpnGw2", "VpnGw3": "VpnGw3"}, - ) - - vpn_client_configuration = cls._args_virtual_network_gateway_update.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrArg( - options=["radius-server-address"], - help="The radius server address property of the VirtualNetworkGateway resource for vpn client connection.", - nullable=True, - ) - vpn_client_configuration.radius_server_secret = AAZStrArg( - options=["radius-server-secret"], - help="The radius secret property of the VirtualNetworkGateway resource for vpn client connection.", - nullable=True, - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectArg( - options=["vpn-client-address-pool"], - help="The reference to the address space resource which represents Address space for P2S VpnClient.", - nullable=True, - ) - cls._build_args_address_space_update(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_protocols = AAZListArg( - options=["vpn-client-protocols"], - help="VpnClientProtocols for Virtual network gateway.", - nullable=True, - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListArg( - options=["vpn-client-revoked-certificates"], - help="VpnClientRevokedCertificate for Virtual network gateway.", - nullable=True, - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListArg( - options=["vpn-client-root-certificates"], - help="VpnClientRootCertificate for virtual network gateway.", - nullable=True, - ) - - vpn_client_protocols = cls._args_virtual_network_gateway_update.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrArg( - nullable=True, - enum={"IkeV2": "IkeV2", "SSTP": "SSTP"}, - ) - - vpn_client_revoked_certificates = cls._args_virtual_network_gateway_update.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_virtual_network_gateway_update.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.thumbprint = AAZStrArg( - options=["thumbprint"], - help="The revoked VPN client certificate thumbprint.", - nullable=True, - ) - - vpn_client_root_certificates = cls._args_virtual_network_gateway_update.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_virtual_network_gateway_update.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.public_cert_data = AAZStrArg( - options=["public-cert-data"], - help="The certificate public data.", - ) - - tags = cls._args_virtual_network_gateway_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.active_active = cls._args_virtual_network_gateway_update.active_active - _schema.bgp_settings = cls._args_virtual_network_gateway_update.bgp_settings - _schema.enable_bgp = cls._args_virtual_network_gateway_update.enable_bgp - _schema.etag = cls._args_virtual_network_gateway_update.etag - _schema.gateway_default_site = cls._args_virtual_network_gateway_update.gateway_default_site - _schema.gateway_type = cls._args_virtual_network_gateway_update.gateway_type - _schema.ip_configurations = cls._args_virtual_network_gateway_update.ip_configurations - _schema.location = cls._args_virtual_network_gateway_update.location - _schema.resource_guid = cls._args_virtual_network_gateway_update.resource_guid - _schema.sku = cls._args_virtual_network_gateway_update.sku - _schema.tags = cls._args_virtual_network_gateway_update.tags - _schema.vpn_client_configuration = cls._args_virtual_network_gateway_update.vpn_client_configuration - _schema.vpn_type = cls._args_virtual_network_gateway_update.vpn_type - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.VirtualNetworkGatewayConnectionsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewayConnectionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_gateway_connection_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewayConnectionsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_gateway_connection_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("enableBgp", AAZBoolType, ".enable_bgp") - properties.set_prop("ipsecPolicies", AAZListType, ".ipsec_policies") - properties.set_prop("routingWeight", AAZIntType, ".routing_weight") - properties.set_prop("sharedKey", AAZStrType, ".shared_key") - properties.set_prop("usePolicyBasedTrafficSelectors", AAZBoolType, ".use_policy_based_traffic_selectors") - - ipsec_policies = _builder.get(".properties.ipsecPolicies") - if ipsec_policies is not None: - ipsec_policies.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipsecPolicies[]") - if _elements is not None: - _elements.set_prop("dhGroup", AAZStrType, ".dh_group", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("ikeEncryption", AAZStrType, ".ike_encryption", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("ikeIntegrity", AAZStrType, ".ike_integrity", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("ipsecEncryption", AAZStrType, ".ipsec_encryption", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("ipsecIntegrity", AAZStrType, ".ipsec_integrity", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("pfsGroup", AAZStrType, ".pfs_group", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("saDataSizeKilobytes", AAZIntType, ".sa_data_size_kilobytes", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("saLifeTimeSeconds", AAZIntType, ".sa_life_time_seconds", typ_kwargs={"flags": {"required": True}}) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_address_space_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_bgp_settings_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("asn", AAZIntType, ".asn") - _builder.set_prop("bgpPeeringAddress", AAZStrType, ".bgp_peering_address") - _builder.set_prop("peerWeight", AAZIntType, ".peer_weight") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_virtual_network_gateway_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("activeActive", AAZBoolType, ".active_active") - cls._build_schema_bgp_settings_update(properties.set_prop("bgpSettings", AAZObjectType, ".bgp_settings")) - properties.set_prop("enableBgp", AAZBoolType, ".enable_bgp") - cls._build_schema_sub_resource_update(properties.set_prop("gatewayDefaultSite", AAZObjectType, ".gateway_default_site")) - properties.set_prop("gatewayType", AAZStrType, ".gateway_type") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("sku", AAZObjectType, ".sku") - properties.set_prop("vpnClientConfiguration", AAZObjectType, ".vpn_client_configuration") - properties.set_prop("vpnType", AAZStrType, ".vpn_type") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - cls._build_schema_sub_resource_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_sub_resource_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - sku = _builder.get(".properties.sku") - if sku is not None: - sku.set_prop("capacity", AAZIntType, ".capacity") - sku.set_prop("name", AAZStrType, ".name") - sku.set_prop("tier", AAZStrType, ".tier") - - vpn_client_configuration = _builder.get(".properties.vpnClientConfiguration") - if vpn_client_configuration is not None: - vpn_client_configuration.set_prop("radiusServerAddress", AAZStrType, ".radius_server_address") - vpn_client_configuration.set_prop("radiusServerSecret", AAZStrType, ".radius_server_secret") - cls._build_schema_address_space_update(vpn_client_configuration.set_prop("vpnClientAddressPool", AAZObjectType, ".vpn_client_address_pool")) - vpn_client_configuration.set_prop("vpnClientProtocols", AAZListType, ".vpn_client_protocols") - vpn_client_configuration.set_prop("vpnClientRevokedCertificates", AAZListType, ".vpn_client_revoked_certificates") - vpn_client_configuration.set_prop("vpnClientRootCertificates", AAZListType, ".vpn_client_root_certificates") - - vpn_client_protocols = _builder.get(".properties.vpnClientConfiguration.vpnClientProtocols") - if vpn_client_protocols is not None: - vpn_client_protocols.set_elements(AAZStrType, ".") - - vpn_client_revoked_certificates = _builder.get(".properties.vpnClientConfiguration.vpnClientRevokedCertificates") - if vpn_client_revoked_certificates is not None: - vpn_client_revoked_certificates.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.vpnClientConfiguration.vpnClientRevokedCertificates[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.vpnClientConfiguration.vpnClientRevokedCertificates[].properties") - if properties is not None: - properties.set_prop("thumbprint", AAZStrType, ".thumbprint") - - vpn_client_root_certificates = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates") - if vpn_client_root_certificates is not None: - vpn_client_root_certificates.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - - properties = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[].properties") - if properties is not None: - properties.set_prop("publicCertData", AAZStrType, ".public_cert_data", typ_kwargs={"flags": {"required": True}}) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_connection_read = None - - @classmethod - def _build_schema_virtual_network_gateway_connection_read(cls, _schema): - if cls._schema_virtual_network_gateway_connection_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - return - - cls._schema_virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read = AAZObjectType() - - virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read - virtual_network_gateway_connection_read.etag = AAZStrType() - virtual_network_gateway_connection_read.id = AAZStrType() - virtual_network_gateway_connection_read.location = AAZStrType() - virtual_network_gateway_connection_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_connection_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_connection_read.tags = AAZDictType() - virtual_network_gateway_connection_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - cls._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - ipsec_policies = _schema_virtual_network_gateway_connection_read.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_connection_read.properties.ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - local_network_gateway2 = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - cls._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tunnel_connection_status = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = _schema_virtual_network_gateway_connection_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_wait.py deleted file mode 100644 index 2af7730e4ec..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/_wait.py +++ /dev/null @@ -1,568 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Connection name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewayConnectionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - _WaitHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - _WaitHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - ipsec_policies = cls._schema_on_200.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - local_network_gateway2 = cls._schema_on_200.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - _WaitHelper._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - _WaitHelper._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = cls._schema_on_200.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tunnel_connection_status = cls._schema_on_200.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/ipsec_policy/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/ipsec_policy/__cmd_group.py deleted file mode 100644 index 3accbdc67e7..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/ipsec_policy/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vpn-connection ipsec-policy", -) -class __CMDGroup(AAZCommandGroup): - """Manage VPN connection IPSec policies. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/ipsec_policy/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/ipsec_policy/__init__.py deleted file mode 100644 index 233ea53b2ea..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/ipsec_policy/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._add import * -from ._list import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/ipsec_policy/_add.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/ipsec_policy/_add.py deleted file mode 100644 index 14db07326ba..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/ipsec_policy/_add.py +++ /dev/null @@ -1,840 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection ipsec-policy add", -) -class Add(AAZCommand): - """Add a VPN connection IPSec policy. - - Set all IPsec policies of a VPN connection. If you want to set any IPsec policy, you must - set them all. - - :example: Add specified IPsec policies to a connection instead of relying on defaults. - az network vpn-connection ipsec-policy add -g MyResourceGroup --connection-name MyConnection --dh-group DHGroup14 --ike-encryption AES256 --ike-integrity SHA384 --ipsec-encryption DES3 --ipsec-integrity GCMAES256 --pfs-group PFS2048 --sa-lifetime 27000 --sa-max-size 102400000 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2017-10-01", "properties.ipsecPolicies[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.connection_name = AAZStrArg( - options=["--connection-name"], - help="Connection name.", - required=True, - ) - _args_schema.ipsec_policy_index = AAZIntArg( - options=["--ipsec-policy-index"], - ) - - # define Arg Group "IKE Phase 1" - - _args_schema = cls._args_schema - _args_schema.dh_group = AAZStrArg( - options=["--dh-group"], - arg_group="IKE Phase 1", - help="The DH Groups used for initial SA.", - required=True, - enum={"DHGroup1": "DHGroup1", "DHGroup14": "DHGroup14", "DHGroup2": "DHGroup2", "DHGroup2048": "DHGroup2048", "DHGroup24": "DHGroup24", "ECP256": "ECP256", "ECP384": "ECP384", "None": "None"}, - ) - _args_schema.ipsec_encryption = AAZStrArg( - options=["--ipsec-encryption"], - arg_group="IKE Phase 1", - help="The IPSec encryption algorithm.", - required=True, - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3", "GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "None": "None"}, - ) - _args_schema.ipsec_integrity = AAZStrArg( - options=["--ipsec-integrity"], - arg_group="IKE Phase 1", - help="The IPSec integrity algorithm.", - required=True, - enum={"GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256"}, - ) - - # define Arg Group "IKE Phase 2" - - _args_schema = cls._args_schema - _args_schema.ike_encryption = AAZStrArg( - options=["--ike-encryption"], - arg_group="IKE Phase 2", - help="The IKE encryption algorithm.", - required=True, - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3"}, - ) - _args_schema.ike_integrity = AAZStrArg( - options=["--ike-integrity"], - arg_group="IKE Phase 2", - help="The IKE integrity algorithm.", - required=True, - enum={"MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256", "SHA384": "SHA384"}, - ) - _args_schema.pfs_group = AAZStrArg( - options=["--pfs-group"], - arg_group="IKE Phase 2", - help="The Pfs Groups used for new child SA.", - required=True, - enum={"ECP256": "ECP256", "ECP384": "ECP384", "None": "None", "PFS1": "PFS1", "PFS2": "PFS2", "PFS2048": "PFS2048", "PFS24": "PFS24"}, - ) - - # define Arg Group "Security Association" - - _args_schema = cls._args_schema - _args_schema.sa_max_size = AAZIntArg( - options=["--sa-max-size"], - arg_group="Security Association", - help="The payload size in KB for P2S client.", - required=True, - ) - _args_schema.sa_lifetime = AAZIntArg( - options=["--sa-lifetime"], - arg_group="Security Association", - help="The lifetime in seconds for P2S client.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.VirtualNetworkGatewayConnectionsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipsecPolicies - filters = enumerate(result) - filters = filter( - lambda e: e[0] == self.ctx.args.ipsec_policy_index, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipsecPolicies - filters = enumerate(result) - filters = filter( - lambda e: e[0] == self.ctx.args.ipsec_policy_index, - filters - ) - idx = next(filters, [len(result)])[0] - self.ctx.args.ipsec_policy_index = idx - result[idx] = value - return - - class VirtualNetworkGatewayConnectionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _AddHelper._build_schema_virtual_network_gateway_connection_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewayConnectionsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _AddHelper._build_schema_virtual_network_gateway_connection_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("dhGroup", AAZStrType, ".dh_group", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ikeEncryption", AAZStrType, ".ike_encryption", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ikeIntegrity", AAZStrType, ".ike_integrity", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ipsecEncryption", AAZStrType, ".ipsec_encryption", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ipsecIntegrity", AAZStrType, ".ipsec_integrity", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("pfsGroup", AAZStrType, ".pfs_group", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("saDataSizeKilobytes", AAZIntType, ".sa_max_size", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("saLifeTimeSeconds", AAZIntType, ".sa_lifetime", typ_kwargs={"flags": {"required": True}}) - - return _instance_value - - -class _AddHelper: - """Helper class for Add""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_connection_read = None - - @classmethod - def _build_schema_virtual_network_gateway_connection_read(cls, _schema): - if cls._schema_virtual_network_gateway_connection_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - return - - cls._schema_virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read = AAZObjectType() - - virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read - virtual_network_gateway_connection_read.etag = AAZStrType() - virtual_network_gateway_connection_read.id = AAZStrType() - virtual_network_gateway_connection_read.location = AAZStrType() - virtual_network_gateway_connection_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_connection_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_connection_read.tags = AAZDictType() - virtual_network_gateway_connection_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - cls._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - ipsec_policies = _schema_virtual_network_gateway_connection_read.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_connection_read.properties.ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - local_network_gateway2 = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - cls._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tunnel_connection_status = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = _schema_virtual_network_gateway_connection_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Add"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/ipsec_policy/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/ipsec_policy/_list.py deleted file mode 100644 index ccf368f81fa..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/ipsec_policy/_list.py +++ /dev/null @@ -1,608 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection ipsec-policy list", -) -class List(AAZCommand): - """List IPSec policies associated with a VPN connection. - - :example: List the IPsec policies set on a connection. - az network vpn-connection ipsec-policy list -g MyResourceGroup --connection-name MyConnection - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2017-10-01", "properties.ipsecPolicies"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.connection_name = AAZStrArg( - options=["--connection-name"], - help="Connection name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.ipsecPolicies - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.ipsecPolicies = value - return - - class VirtualNetworkGatewayConnectionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_virtual_network_gateway_connection_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_connection_read = None - - @classmethod - def _build_schema_virtual_network_gateway_connection_read(cls, _schema): - if cls._schema_virtual_network_gateway_connection_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - return - - cls._schema_virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read = AAZObjectType() - - virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read - virtual_network_gateway_connection_read.etag = AAZStrType() - virtual_network_gateway_connection_read.id = AAZStrType() - virtual_network_gateway_connection_read.location = AAZStrType() - virtual_network_gateway_connection_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_connection_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_connection_read.tags = AAZDictType() - virtual_network_gateway_connection_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - cls._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - ipsec_policies = _schema_virtual_network_gateway_connection_read.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_connection_read.properties.ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - local_network_gateway2 = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - cls._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tunnel_connection_status = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = _schema_virtual_network_gateway_connection_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/ipsec_policy/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/ipsec_policy/_wait.py deleted file mode 100644 index dc55ee76fea..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/ipsec_policy/_wait.py +++ /dev/null @@ -1,593 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection ipsec-policy wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2017-10-01", "properties.ipsecPolicies[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.connection_name = AAZStrArg( - options=["--connection-name"], - help="Connection name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewayConnectionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_virtual_network_gateway_connection_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_connection_read = None - - @classmethod - def _build_schema_virtual_network_gateway_connection_read(cls, _schema): - if cls._schema_virtual_network_gateway_connection_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - return - - cls._schema_virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read = AAZObjectType() - - virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read - virtual_network_gateway_connection_read.etag = AAZStrType() - virtual_network_gateway_connection_read.id = AAZStrType() - virtual_network_gateway_connection_read.location = AAZStrType() - virtual_network_gateway_connection_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_connection_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_connection_read.tags = AAZDictType() - virtual_network_gateway_connection_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - cls._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - ipsec_policies = _schema_virtual_network_gateway_connection_read.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_connection_read.properties.ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - local_network_gateway2 = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - cls._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tunnel_connection_status = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = _schema_virtual_network_gateway_connection_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/shared_key/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/shared_key/__cmd_group.py deleted file mode 100644 index 578d7fccf42..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/shared_key/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vpn-connection shared-key", -) -class __CMDGroup(AAZCommandGroup): - """Manage VPN shared keys. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/shared_key/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/shared_key/__init__.py deleted file mode 100644 index c7524bb868c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/shared_key/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._reset import * -from ._show import * -from ._update import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/shared_key/_reset.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/shared_key/_reset.py deleted file mode 100644 index db7d9c94d51..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/shared_key/_reset.py +++ /dev/null @@ -1,211 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection shared-key reset", -) -class Reset(AAZCommand): - """Reset a VPN connection shared key. - - :example: Reset the shared key on a connection. - az network vpn-connection shared-key reset -g MyResourceGroup --connection-name MyConnection --key-length 128 - - :example: Reset a VPN connection shared key. - az network vpn-connection shared-key reset --connection-name MyConnection --key-length 128 --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}/sharedkey/reset", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.connection_name = AAZStrArg( - options=["--connection-name"], - help="Connection name.", - required=True, - id_part="name", - ) - _args_schema.key_length = AAZIntArg( - options=["--key-length"], - help="The virtual network connection reset shared key length, should between 1 and 128.", - required=True, - fmt=AAZIntArgFormat( - maximum=128, - minimum=1, - ), - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewayConnectionsResetSharedKey(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewayConnectionsResetSharedKey(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("keyLength", AAZIntType, ".key_length", typ_kwargs={"flags": {"required": True}}) - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.key_length = AAZIntType( - serialized_name="keyLength", - flags={"required": True}, - ) - - return cls._schema_on_200 - - -class _ResetHelper: - """Helper class for Reset""" - - -__all__ = ["Reset"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/shared_key/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/shared_key/_show.py deleted file mode 100644 index c382e3e082f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/shared_key/_show.py +++ /dev/null @@ -1,170 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection shared-key show", -) -class Show(AAZCommand): - """Retrieve a VPN connection shared key. - - :example: View the shared key of a connection. - az network vpn-connection shared-key show -g MyResourceGroup --connection-name MyConnection - - :example: Retrieve a VPN connection shared key. - az network vpn-connection shared-key show --connection-name MyConnection --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}/sharedkey", "2017-10-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.connection_name = AAZStrArg( - options=["--connection-name"], - help="Connection name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGetSharedKey(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewayConnectionsGetSharedKey(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.value = AAZStrType( - flags={"required": True}, - ) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/shared_key/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/shared_key/_update.py deleted file mode 100644 index 68dcc1a0e4d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2018_03_01_hybrid/network/vpn_connection/shared_key/_update.py +++ /dev/null @@ -1,337 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection shared-key update", -) -class Update(AAZCommand): - """Update a VPN connection shared key. - - :example: Change the shared key for the connection to "Abc123". - az network vpn-connection shared-key update -g MyResourceGroup --connection-name MyConnection --value Abc123 - - :example: Update a VPN connection shared key. - az network vpn-connection shared-key update --connection-name MyConnection --resource-group MyResourceGroup --subscription MySubscription --value Abc123 - """ - - _aaz_info = { - "version": "2017-10-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}/sharedkey", "2017-10-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.connection_name = AAZStrArg( - options=["--connection-name"], - help="Connection name.", - required=True, - id_part="name", - ) - _args_schema.value = AAZStrArg( - options=["--value"], - help="The virtual network connection shared key value.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGetSharedKey(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.VirtualNetworkGatewayConnectionsSetSharedKey(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewayConnectionsGetSharedKey(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_connection_shared_key_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewayConnectionsSetSharedKey(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2017-10-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_connection_shared_key_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("value", AAZStrType, ".value", typ_kwargs={"flags": {"required": True}}) - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_connection_shared_key_read = None - - @classmethod - def _build_schema_connection_shared_key_read(cls, _schema): - if cls._schema_connection_shared_key_read is not None: - _schema.value = cls._schema_connection_shared_key_read.value - return - - cls._schema_connection_shared_key_read = _schema_connection_shared_key_read = AAZObjectType() - - connection_shared_key_read = _schema_connection_shared_key_read - connection_shared_key_read.value = AAZStrType( - flags={"required": True}, - ) - - _schema.value = cls._schema_connection_shared_key_read.value - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/__init__.py deleted file mode 100644 index f6acc11aa4e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 - diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/__cmd_group.py deleted file mode 100644 index 5093d2928ba..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/__init__.py deleted file mode 100644 index 1ec185c184e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._list_usages import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/_list_usages.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/_list_usages.py deleted file mode 100644 index fe862e71af5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/_list_usages.py +++ /dev/null @@ -1,185 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network list-usages", -) -class ListUsages(AAZCommand): - """List the number of network resources in a region that are used against a subscription quota. - - :example: List the provisioned network resources in East US region within a subscription. - az network list-usages --location eastus -o table - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/locations/{}/usages", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.UsagesList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class UsagesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "location", self.ctx.args.location, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.current_value = AAZIntType( - serialized_name="currentValue", - flags={"required": True}, - ) - _element.id = AAZStrType( - flags={"read_only": True}, - ) - _element.limit = AAZIntType( - flags={"required": True}, - ) - _element.name = AAZObjectType( - flags={"required": True}, - ) - _element.unit = AAZStrType( - flags={"required": True}, - ) - - name = cls._schema_on_200.value.Element.name - name.localized_value = AAZStrType( - serialized_name="localizedValue", - ) - name.value = AAZStrType() - - return cls._schema_on_200 - - -class _ListUsagesHelper: - """Helper class for ListUsages""" - - -__all__ = ["ListUsages"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/__cmd_group.py deleted file mode 100644 index 154e082d718..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb", -) -class __CMDGroup(AAZCommandGroup): - """Manage and configure load balancers. - - To learn more about Azure Load Balancer visit https://learn.microsoft.com/en-us/azure/load-balancer/quickstart-load-balancer-standard-public-cli. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/__init__.py deleted file mode 100644 index 8fb933aeeb1..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._list_nic import * -from ._show import * -from ._update import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_create.py deleted file mode 100644 index 3f4da538d59..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_create.py +++ /dev/null @@ -1,2459 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Create(AAZCommand): - """Create a load balancer. - - :example: Create a basic load balancer. - az network lb create -g MyResourceGroup -n MyLb --sku Basic - - :example: Create a basic load balancer on a specific virtual network and subnet If a virtual network with the same name is found in the same resource group, the load balancer will utilize this virtual network. If one is not found a new one will be created. - az network lb create -g MyResourceGroup -n MyLb --sku Basic --vnet-name MyVnet --subnet MySubnet - - :example: Create a basic load balancer on a subnet of a pre-existing virtual network. The subnet can be in arbitary resource group or subscription by providing the ID of the subnet. - az network lb create -g MyResourceGroup -n MyLb --sku Basic --subnet {subnetID} - - :example: Create a basic zone flavored internal load balancer, through provisioning a zonal public ip. - az network lb create -g MyResourceGroup -n MyLb --sku Basic --public-ip-zone 2 - - :example: Create a standard zone flavored public-facing load balancer, through provisioning a zonal frontend ip configuration and Vnet. - az etwork lb create -g MyResourceGroup -n MyLb --sku Standard --frontend-ip-zone 1 --vnet-name MyVnet --subnet MySubnet - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - arg_group="Parameters", - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.sku = AAZObjectArg( - options=["--sku"], - arg_group="Parameters", - help="The load balancer SKU.", - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Parameters", - help="Resource tags.", - ) - - sku = cls._args_schema.sku - sku.name = AAZStrArg( - options=["name"], - help="Name of a load balancer SKU.", - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_address_pools = AAZListArg( - options=["--backend-address-pools"], - arg_group="Properties", - help="Collection of backend address pools used by a load balancer.", - ) - _args_schema.inbound_nat_pools = AAZListArg( - options=["--inbound-nat-pools"], - arg_group="Properties", - help="Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound NAT rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules.", - ) - _args_schema.inbound_nat_rules = AAZListArg( - options=["--inbound-nat-rules"], - arg_group="Properties", - help="Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules.", - ) - _args_schema.load_balancing_rules = AAZListArg( - options=["--load-balancing-rules"], - arg_group="Properties", - help="Object collection representing the load balancing rules Gets the provisioning.", - ) - _args_schema.outbound_rules = AAZListArg( - options=["--outbound-rules"], - arg_group="Properties", - help="The outbound rules.", - ) - _args_schema.probes = AAZListArg( - options=["--probes"], - arg_group="Properties", - help="Collection of probe objects used in the load balancer.", - ) - - backend_address_pools = cls._args_schema.backend_address_pools - backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_schema.backend_address_pools.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resource.", - ) - - inbound_nat_pools = cls._args_schema.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectArg() - - _element = cls._args_schema.inbound_nat_pools.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource.", - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.enable_tcp_reset = AAZBoolArg( - options=["enable-tcp-reset"], - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port_range_end = AAZIntArg( - options=["frontend-port-range-end"], - help="The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535.", - ) - _element.frontend_port_range_start = AAZIntArg( - options=["frontend-port-range-start"], - help="The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The reference to the transport protocol used by the inbound NAT pool.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - inbound_nat_rules = cls._args_schema.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_schema.inbound_nat_rules.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource.", - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.enable_tcp_reset = AAZBoolArg( - options=["enable-tcp-reset"], - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The reference to the transport protocol used by the load balancing rule.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - load_balancing_rules = cls._args_schema.load_balancing_rules - load_balancing_rules.Element = AAZObjectArg() - - _element = cls._args_schema.load_balancing_rules.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of load balancing rules used by the load balancer. This name can be used to access the resource.", - ) - _element.backend_address_pool = AAZObjectArg( - options=["backend-address-pool"], - help="A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs.", - ) - cls._build_args_sub_resource_create(_element.backend_address_pool) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables \"Any Port\".", - ) - _element.disable_outbound_snat = AAZBoolArg( - options=["disable-outbound-snat"], - help="Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["floating-ip", "enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.enable_tcp_reset = AAZBoolArg( - options=["enable-tcp-reset"], - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables \"Any Port\".", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout", "idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.load_distribution = AAZStrArg( - options=["load-distribution"], - help="The load distribution policy for this rule.", - enum={"Default": "Default", "SourceIP": "SourceIP", "SourceIPProtocol": "SourceIPProtocol"}, - ) - _element.probe = AAZObjectArg( - options=["probe"], - help="The reference to the load balancer probe used by the load balancing rule.", - ) - cls._build_args_sub_resource_create(_element.probe) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The reference to the transport protocol used by the load balancing rule.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - outbound_rules = cls._args_schema.outbound_rules - outbound_rules.Element = AAZObjectArg() - - _element = cls._args_schema.outbound_rules.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of outbound rules used by the load balancer. This name can be used to access the resource.", - ) - _element.allocated_outbound_ports = AAZIntArg( - options=["outbound-ports", "allocated-outbound-ports"], - help="The number of outbound ports to be used for NAT.", - ) - _element.backend_address_pool = AAZObjectArg( - options=["backend-address-pool"], - help="A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs.", - ) - cls._build_args_sub_resource_create(_element.backend_address_pool) - _element.enable_tcp_reset = AAZBoolArg( - options=["enable-tcp-reset"], - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - ) - _element.frontend_ip_configurations = AAZListArg( - options=["frontend-ip-configurations"], - help="The Frontend IP addresses of the load balancer.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout", "idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The protocol for the outbound rule in load balancer.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - frontend_ip_configurations = cls._args_schema.outbound_rules.Element.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectArg() - cls._build_args_sub_resource_create(frontend_ip_configurations.Element) - - probes = cls._args_schema.probes - probes.Element = AAZObjectArg() - - _element = cls._args_schema.probes.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of probes used by the load balancer. This name can be used to access the resource.", - ) - _element.interval_in_seconds = AAZIntArg( - options=["interval", "interval-in-seconds"], - help={"short-summary": "The interval, in seconds, for how frequently to probe the endpoint for health status.", "long-summary": "Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5."}, - ) - _element.number_of_probes = AAZIntArg( - options=["threshold", "number-of-probes"], - help={"short-summary": "The number of consecutive probe failures before an instance is deemed unhealthy.", "long-summary": "This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure."}, - ) - _element.port = AAZIntArg( - options=["port"], - help="The port for communicating the probe. Possible values range from 1 to 65535, inclusive.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help={"short-summary": "The protocol of the end point.", "long-summary": "If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful."}, - enum={"Http": "Http", "Https": "Https", "Tcp": "Tcp"}, - ) - _element.request_path = AAZStrArg( - options=["path", "request-path"], - help="The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed.", - ) - return cls._args_schema - - _args_application_security_group_create = None - - @classmethod - def _build_args_application_security_group_create(cls, _schema): - if cls._args_application_security_group_create is not None: - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - return - - cls._args_application_security_group_create = AAZObjectArg() - - application_security_group_create = cls._args_application_security_group_create - application_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - security_rule_create.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - security_rule_create.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_create.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - - _args_sub_resource_create = None - - @classmethod - def _build_args_sub_resource_create(cls, _schema): - if cls._args_sub_resource_create is not None: - _schema.id = cls._args_sub_resource_create.id - return - - cls._args_sub_resource_create = AAZObjectArg() - - sub_resource_create = cls._args_sub_resource_create - sub_resource_create.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - - _schema.id = cls._args_sub_resource_create.id - - def _execute_operations(self): - self.pre_operations() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("sku", AAZObjectType, ".sku") - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendAddressPools", AAZListType, ".backend_address_pools") - properties.set_prop("inboundNatPools", AAZListType, ".inbound_nat_pools") - properties.set_prop("inboundNatRules", AAZListType, ".inbound_nat_rules") - properties.set_prop("loadBalancingRules", AAZListType, ".load_balancing_rules") - properties.set_prop("outboundRules", AAZListType, ".outbound_rules") - properties.set_prop("probes", AAZListType, ".probes") - - backend_address_pools = _builder.get(".properties.backendAddressPools") - if backend_address_pools is not None: - backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.backendAddressPools[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - inbound_nat_pools = _builder.get(".properties.inboundNatPools") - if inbound_nat_pools is not None: - inbound_nat_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.inboundNatPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.inboundNatPools[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPortRangeEnd", AAZIntType, ".frontend_port_range_end", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("frontendPortRangeStart", AAZIntType, ".frontend_port_range_start", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - inbound_nat_rules = _builder.get(".properties.inboundNatRules") - if inbound_nat_rules is not None: - inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.inboundNatRules[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.inboundNatRules[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - - load_balancing_rules = _builder.get(".properties.loadBalancingRules") - if load_balancing_rules is not None: - load_balancing_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancingRules[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancingRules[].properties") - if properties is not None: - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("backendAddressPool", AAZObjectType, ".backend_address_pool")) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("disableOutboundSnat", AAZBoolType, ".disable_outbound_snat") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("loadDistribution", AAZStrType, ".load_distribution") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("probe", AAZObjectType, ".probe")) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - outbound_rules = _builder.get(".properties.outboundRules") - if outbound_rules is not None: - outbound_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.outboundRules[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.outboundRules[].properties") - if properties is not None: - properties.set_prop("allocatedOutboundPorts", AAZIntType, ".allocated_outbound_ports") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("backendAddressPool", AAZObjectType, ".backend_address_pool", typ_kwargs={"flags": {"required": True}})) - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - properties.set_prop("frontendIPConfigurations", AAZListType, ".frontend_ip_configurations", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - frontend_ip_configurations = _builder.get(".properties.outboundRules[].properties.frontendIPConfigurations") - if frontend_ip_configurations is not None: - _CreateHelper._build_schema_sub_resource_create(frontend_ip_configurations.set_elements(AAZObjectType, ".")) - - probes = _builder.get(".properties.probes") - if probes is not None: - probes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.probes[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.probes[].properties") - if properties is not None: - properties.set_prop("intervalInSeconds", AAZIntType, ".interval_in_seconds") - properties.set_prop("numberOfProbes", AAZIntType, ".number_of_probes") - properties.set_prop("port", AAZIntType, ".port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("requestPath", AAZStrType, ".request_path") - - sku = _builder.get(".sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".name") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.location = AAZStrType() - _schema_on_200_201.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200_201.sku = AAZObjectType() - _schema_on_200_201.tags = AAZDictType() - _schema_on_200_201.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = cls._schema_on_200_201.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - _CreateHelper._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = cls._schema_on_200_201.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _CreateHelper._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = cls._schema_on_200_201.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _CreateHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = cls._schema_on_200_201.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _CreateHelper._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200_201.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - _CreateHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _CreateHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = cls._schema_on_200_201.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - _CreateHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = cls._schema_on_200_201.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = cls._schema_on_200_201.properties.probes - probes.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = cls._schema_on_200_201.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = cls._schema_on_200_201.sku - sku.name = AAZStrType() - - tags = cls._schema_on_200_201.tags - tags.Element = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_application_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_sub_resource_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_delete.py deleted file mode 100644 index 2dfc60712cf..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb delete", -) -class Delete(AAZCommand): - """Delete the specified load balancer. - - :example: Delete a load balancer. - az network lb delete -g MyResourceGroup -n MyLb - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.LoadBalancersDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class LoadBalancersDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_list.py deleted file mode 100644 index a1f92368ba0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_list.py +++ /dev/null @@ -1,2049 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb list", -) -class List(AAZCommand): - """List load balancers. - - :example: List load balancers. - az network lb list -g MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/loadbalancers", "2018-11-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.LoadBalancersList(ctx=self.ctx)() - if condition_1: - self.LoadBalancersListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class LoadBalancersList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.sku = AAZObjectType() - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = cls._schema_on_200.value.Element.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - _ListHelper._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = cls._schema_on_200.value.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _ListHelper._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = cls._schema_on_200.value.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ListHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = cls._schema_on_200.value.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _ListHelper._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - _ListHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ListHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = cls._schema_on_200.value.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - _ListHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = cls._schema_on_200.value.Element.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = cls._schema_on_200.value.Element.properties.probes - probes.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = cls._schema_on_200.value.Element.sku - sku.name = AAZStrType() - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - class LoadBalancersListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.sku = AAZObjectType() - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = cls._schema_on_200.value.Element.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - _ListHelper._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = cls._schema_on_200.value.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _ListHelper._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = cls._schema_on_200.value.Element.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ListHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = cls._schema_on_200.value.Element.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _ListHelper._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - _ListHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ListHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = cls._schema_on_200.value.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - _ListHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = cls._schema_on_200.value.Element.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = cls._schema_on_200.value.Element.properties.probes - probes.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = cls._schema_on_200.value.Element.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = cls._schema_on_200.value.Element.sku - sku.name = AAZStrType() - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_list_nic.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_list_nic.py deleted file mode 100644 index c00dc444a4b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_list_nic.py +++ /dev/null @@ -1,1440 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb list-nic", -) -class ListNic(AAZCommand): - """List associated load balancer network interfaces. - - :example: List associated load balancer network interfaces. - az network lb list-nic -g MyResourceGroup --name MyLb - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}/networkinterfaces", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancerNetworkInterfacesList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class LoadBalancerNetworkInterfacesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListNicHelper._build_schema_network_interface_read(value.Element) - - return cls._schema_on_200 - - -class _ListNicHelper: - """Helper class for ListNic""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["ListNic"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_show.py deleted file mode 100644 index b3e634868bf..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_show.py +++ /dev/null @@ -1,1732 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb show", -) -class Show(AAZCommand): - """Get the details of a load balancer. - - :example: Get the details of a load balancer. - az network lb show -g MyResourceGroup -n MyLb - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.sku = AAZObjectType() - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = cls._schema_on_200.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - _ShowHelper._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = cls._schema_on_200.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _ShowHelper._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = cls._schema_on_200.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ShowHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = cls._schema_on_200.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _ShowHelper._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - _ShowHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _ShowHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = cls._schema_on_200.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - _ShowHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = cls._schema_on_200.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = cls._schema_on_200.properties.probes - probes.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = cls._schema_on_200.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = cls._schema_on_200.sku - sku.name = AAZStrType() - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_update.py deleted file mode 100644 index 8f3e8c148b1..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_update.py +++ /dev/null @@ -1,2296 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb update", -) -class Update(AAZCommand): - """Update a load balancer. - - This command can only be used to update the tags for a load balancer. Name and resource group are immutable and cannot be updated. - - :example: Update the tags of a load balancer. - az network lb update -g MyResourceGroup -n MyLB --tags CostCenter=MyTestGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.probes = AAZListArg( - options=["--probes"], - arg_group="Properties", - help="Collection of probe objects used in the load balancer.", - nullable=True, - ) - - probes = cls._args_schema.probes - probes.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.probes.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of probes used by the load balancer. This name can be used to access the resource.", - nullable=True, - ) - _element.interval_in_seconds = AAZIntArg( - options=["interval", "interval-in-seconds"], - help={"short-summary": "The interval, in seconds, for how frequently to probe the endpoint for health status.", "long-summary": "Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5."}, - nullable=True, - ) - _element.number_of_probes = AAZIntArg( - options=["threshold", "number-of-probes"], - help={"short-summary": "The number of consecutive probe failures before an instance is deemed unhealthy.", "long-summary": "This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure."}, - nullable=True, - ) - _element.port = AAZIntArg( - options=["port"], - help="The port for communicating the probe. Possible values range from 1 to 65535, inclusive.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help={"short-summary": "The protocol of the end point.", "long-summary": "If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful."}, - enum={"Http": "Http", "Https": "Https", "Tcp": "Tcp"}, - ) - _element.request_path = AAZStrArg( - options=["path", "request-path"], - help="The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed.", - nullable=True, - ) - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("probes", AAZListType, ".probes") - - probes = _builder.get(".properties.probes") - if probes is not None: - probes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.probes[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.probes[].properties") - if properties is not None: - properties.set_prop("intervalInSeconds", AAZIntType, ".interval_in_seconds") - properties.set_prop("numberOfProbes", AAZIntType, ".number_of_probes") - properties.set_prop("port", AAZIntType, ".port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("requestPath", AAZStrType, ".request_path") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_wait.py deleted file mode 100644 index 5b14d544687..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/_wait.py +++ /dev/null @@ -1,1728 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.sku = AAZObjectType() - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = cls._schema_on_200.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - _WaitHelper._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = cls._schema_on_200.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _WaitHelper._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = cls._schema_on_200.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _WaitHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = cls._schema_on_200.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - _WaitHelper._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = cls._schema_on_200.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - _WaitHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - _WaitHelper._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = cls._schema_on_200.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - _WaitHelper._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = cls._schema_on_200.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = cls._schema_on_200.properties.probes - probes.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = cls._schema_on_200.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = cls._schema_on_200.sku - sku.name = AAZStrType() - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/__cmd_group.py deleted file mode 100644 index cf0d53eb3e1..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb address-pool", -) -class __CMDGroup(AAZCommandGroup): - """Manage address pools of a load balancer. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/__init__.py deleted file mode 100644 index 2d1a2078686..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/_create.py deleted file mode 100644 index 739516be887..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/_create.py +++ /dev/null @@ -1,1925 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb address-pool create", -) -class Create(AAZCommand): - """Create an address pool. - - :example: Create an address pool. - az network lb address-pool create -g MyResourceGroup --lb-name MyLb -n MyAddressPool - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.backendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.address_pool_name = AAZStrArg( - options=["-n", "--name", "--address-pool-name"], - help="The name of the backend address pool.", - required=True, - ) - - # define Arg Group "Parameters.properties.backendAddressPools[]" - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".address_pool_name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/_delete.py deleted file mode 100644 index 5ea024d1788..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/_delete.py +++ /dev/null @@ -1,1907 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb address-pool delete", -) -class Delete(AAZCommand): - """Delete an address pool. - - :example: Delete an address pool. - az network lb address-pool delete -g MyResourceGroup --lb-name MyLb -n MyAddressPool - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.backendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.address_pool_name = AAZStrArg( - options=["-n", "--name", "--address-pool-name"], - help="The name of the backend address pool.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/_list.py deleted file mode 100644 index bc3445e4db4..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/_list.py +++ /dev/null @@ -1,1763 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb address-pool list", -) -class List(AAZCommand): - """List address pools. - - :example: List address pools. - az network lb address-pool list -g MyResourceGroup --lb-name MyLb - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.backendAddressPools"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.backendAddressPools - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.backendAddressPools = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/_show.py deleted file mode 100644 index b3a683f386f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/_show.py +++ /dev/null @@ -1,1782 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb address-pool show", -) -class Show(AAZCommand): - """Get the details of an address pool. - - :example: Get the details of an address pool. - az network lb address-pool show -g MyResourceGroup --lb-name MyLb -n MyAddressPool - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.backendAddressPools[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.address_pool_name = AAZStrArg( - options=["-n", "--name", "--address-pool-name"], - help="The name of the backend address pool.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.backendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.address_pool_name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/_wait.py deleted file mode 100644 index 582c4bd4f39..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/address_pool/_wait.py +++ /dev/null @@ -1,1748 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb address-pool wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.backendAddressPools[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/__cmd_group.py deleted file mode 100644 index 80debcfe9ee..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb frontend-ip", -) -class __CMDGroup(AAZCommandGroup): - """Manage frontend IP addresses of a load balancer. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_create.py deleted file mode 100644 index b82a52c537a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_create.py +++ /dev/null @@ -1,2272 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip create", -) -class Create(AAZCommand): - """Create a frontend IP address. - - :example: Create a frontend ip address for a public load balancer. - az network lb frontend-ip create -g MyResourceGroup -n MyFrontendIp --lb-name MyLb --public-ip-address MyFrontendIp - - :example: Create a frontend ip address for an internal load balancer. - az network lb frontend-ip create -g MyResourceGroup -n MyFrontendIp --lb-name MyLb --private-ip-address 10.10.10.100 --subnet MySubnet --vnet-name MyVnet - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.frontendIPConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the frontend IP configuration.", - required=True, - ) - - # define Arg Group "Parameters.properties.frontendIPConfigurations[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="Properties", - help="Static private IP address to associate with the configuration.", - ) - _args_schema.private_ip_allocation_method = AAZStrArg( - options=["--private-ip-allocation-method"], - arg_group="Properties", - help="The Private IP allocation method.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="Properties", - help="Name or ID of the existing public IP to associate with the configuration.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - _args_schema.public_ip_prefix = AAZStrArg( - options=["--public-ip-prefix"], - arg_group="Properties", - help="Name or ID of a public IP prefix.", - ) - _args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="Properties", - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}", - ), - ) - _args_schema.zones = AAZListArg( - options=["-z", "--zone", "--zones"], - arg_group="Properties", - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - ) - - zones = cls._args_schema.zones - zones.Element = AAZStrArg() - - # define Arg Group "PublicIpAddress" - - # define Arg Group "Subnet" - - # define Arg Group "Subnets" - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg() - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg() - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg() - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - - _schema.id = cls._args_sub_resource_update.id - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType) - properties.set_prop("publicIPPrefix", AAZObjectType) - properties.set_prop("subnet", AAZObjectType) - - public_ip_address = _builder.get(".properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".public_ip_address") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - public_ip_prefix = _builder.get(".properties.publicIPPrefix") - if public_ip_prefix is not None: - public_ip_prefix.set_prop("id", AAZStrType, ".public_ip_prefix") - - subnet = _builder.get(".properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - zones = _builder.get(".zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_delete.py deleted file mode 100644 index 3b49a90b095..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_delete.py +++ /dev/null @@ -1,1907 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip delete", -) -class Delete(AAZCommand): - """Delete a frontend IP address. - - :example: Delete a frontend IP address. - az network lb frontend-ip delete -g MyResourceGroup --lb-name MyLb -n MyFrontendIp - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.frontendIPConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the frontend IP configuration.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_list.py deleted file mode 100644 index 16b915bc9d4..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_list.py +++ /dev/null @@ -1,1763 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip list", -) -class List(AAZCommand): - """List frontend IP addresses. - - :example: List frontend IP addresses. - az network lb frontend-ip list -g MyResourceGroup --lb-name MyLb - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.frontendIPConfigurations"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.frontendIPConfigurations - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.frontendIPConfigurations = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_show.py deleted file mode 100644 index 41bfc76cda9..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_show.py +++ /dev/null @@ -1,1782 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip show", -) -class Show(AAZCommand): - """Get the details of a frontend IP address. - - :example: Get the details of a frontend IP address. - az network lb frontend-ip show -g MyResourceGroup --lb-name MyLb -n MyFrontendIp - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.frontendIPConfigurations[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the frontend IP configuration.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_update.py deleted file mode 100644 index 8f746a8b5e1..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_update.py +++ /dev/null @@ -1,2331 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip update", -) -class Update(AAZCommand): - """Update a frontend IP address. - - :example: Update the frontend IP address of a public load balancer. - az network lb frontend-ip update -g MyResourceGroup --lb-name MyLb -n MyFrontendIp --public-ip-address MyNewPublicIp - - :example: Update the frontend IP address of an internal load balancer. - az network lb frontend-ip update -g MyResourceGroup --lb-name MyLb -n MyFrontendIp --private-ip-address 10.10.10.50 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.frontendIPConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the frontend IP configuration.", - required=True, - ) - - # define Arg Group "Parameters.properties.frontendIPConfigurations[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="Properties", - help="Static private IP address to associate with the configuration.", - nullable=True, - ) - _args_schema.private_ip_allocation_method = AAZStrArg( - options=["--private-ip-allocation-method"], - arg_group="Properties", - help="The Private IP allocation method.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="Properties", - help="Name or ID of the existing public IP to associate with the configuration.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - _args_schema.public_ip_prefix = AAZStrArg( - options=["--public-ip-prefix"], - arg_group="Properties", - help="Name or ID of a public IP prefix.", - nullable=True, - ) - _args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="Properties", - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}", - ), - ) - _args_schema.zones = AAZListArg( - options=["-z", "--zone", "--zones"], - arg_group="Properties", - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - nullable=True, - ) - - zones = cls._args_schema.zones - zones.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "PublicIpAddress" - - # define Arg Group "Subnet" - - # define Arg Group "Subnets" - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.frontendIPConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType) - properties.set_prop("publicIPPrefix", AAZObjectType) - properties.set_prop("subnet", AAZObjectType) - - public_ip_address = _builder.get(".properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".public_ip_address") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - public_ip_prefix = _builder.get(".properties.publicIPPrefix") - if public_ip_prefix is not None: - public_ip_prefix.set_prop("id", AAZStrType, ".public_ip_prefix") - - subnet = _builder.get(".properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - zones = _builder.get(".zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_wait.py deleted file mode 100644 index 34f04339364..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/frontend_ip/_wait.py +++ /dev/null @@ -1,1748 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb frontend-ip wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.frontendIPConfigurations[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/__cmd_group.py deleted file mode 100644 index 8c9b57a8e8a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb inbound-nat-pool", -) -class __CMDGroup(AAZCommandGroup): - """Manage inbound NAT address pools of a load balancer. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_create.py deleted file mode 100644 index 79e0af4ad68..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_create.py +++ /dev/null @@ -1,1983 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool create", -) -class Create(AAZCommand): - """Create an inbound NAT address pool. - - :example: Create an inbound NAT address pool. - az network lb inbound-nat-pool create -g MyResourceGroup --lb-name MyLb -n MyNatPool --protocol Tcp --frontend-port-range-start 80 --frontend-port-range-end 89 --backend-port 80 --frontend-ip MyFrontendIp - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.inboundNatPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource.", - required=True, - ) - - # define Arg Group "Parameters.properties.inboundNatPools[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535.", - ) - _args_schema.enable_floating_ip = AAZBoolArg( - options=["--floating-ip", "--enable-floating-ip"], - arg_group="Properties", - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _args_schema.enable_tcp_reset = AAZBoolArg( - options=["--enable-tcp-reset"], - arg_group="Properties", - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name or ID of the frontend IP configuration.", - ) - _args_schema.frontend_port_range_end = AAZIntArg( - options=["--frontend-port-range-end"], - arg_group="Properties", - help="The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535.", - ) - _args_schema.frontend_port_range_start = AAZIntArg( - options=["--frontend-port-range-start"], - arg_group="Properties", - help="The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534.", - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the inbound NAT pool.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPortRangeEnd", AAZIntType, ".frontend_port_range_end", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("frontendPortRangeStart", AAZIntType, ".frontend_port_range_start", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_delete.py deleted file mode 100644 index 972b018de91..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_delete.py +++ /dev/null @@ -1,1907 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool delete", -) -class Delete(AAZCommand): - """Delete an inbound NAT address pool. - - :example: Delete an inbound NAT address pool. - az network lb inbound-nat-pool delete -g MyResourceGroup --lb-name MyLb -n MyNatPool - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.inboundNatPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_list.py deleted file mode 100644 index 829230c27b7..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_list.py +++ /dev/null @@ -1,1763 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool list", -) -class List(AAZCommand): - """List inbound NAT address pools. - - :example: List inbound NAT address pools. - az network lb inbound-nat-pool list -g MyResourceGroup --lb-name MyLb - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.inboundNatPools"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.inboundNatPools - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.inboundNatPools = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_show.py deleted file mode 100644 index 891fffcbb8a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_show.py +++ /dev/null @@ -1,1782 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool show", -) -class Show(AAZCommand): - """Get the details of an inbound NAT address pool. - - :example: Get the details of an inbound NAT address pool. - az network lb inbound-nat-pool show -g MyResourceGroup --lb-name MyLb -n MyNatPool - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.inboundNatPools[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_update.py deleted file mode 100644 index c2e18aba2a0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_update.py +++ /dev/null @@ -1,2002 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool update", -) -class Update(AAZCommand): - """Update an inbound NAT address pool. - - :example: Update an inbound NAT address pool to a different backend port. - az network lb inbound-nat-pool update -g MyResourceGroup --lb-name MyLb -n MyNatPool --protocol Tcp --backend-port 8080 - - :example: Update an inbound NAT address pool. - az network lb inbound-nat-pool update --backend-port 8080 --enable-tcp-reset true --frontend-port-range-end 89 --frontend-port-range-start 80 --lb-name MyLb --name MyNatPool --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.inboundNatPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource.", - required=True, - ) - - # define Arg Group "Parameters.properties.inboundNatPools[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535.", - ) - _args_schema.enable_floating_ip = AAZBoolArg( - options=["--floating-ip", "--enable-floating-ip"], - arg_group="Properties", - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - _args_schema.enable_tcp_reset = AAZBoolArg( - options=["--enable-tcp-reset"], - arg_group="Properties", - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name or ID of the frontend IP configuration.", - nullable=True, - ) - _args_schema.frontend_port_range_end = AAZIntArg( - options=["--frontend-port-range-end"], - arg_group="Properties", - help="The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535.", - ) - _args_schema.frontend_port_range_start = AAZIntArg( - options=["--frontend-port-range-start"], - arg_group="Properties", - help="The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534.", - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the inbound NAT pool.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPortRangeEnd", AAZIntType, ".frontend_port_range_end", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("frontendPortRangeStart", AAZIntType, ".frontend_port_range_start", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_wait.py deleted file mode 100644 index a9d1aaa4284..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_pool/_wait.py +++ /dev/null @@ -1,1748 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-pool wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.inboundNatPools[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/__cmd_group.py deleted file mode 100644 index a55f1585dd7..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb inbound-nat-rule", -) -class __CMDGroup(AAZCommandGroup): - """Manage inbound NAT rules of a load balancer. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_create.py deleted file mode 100644 index d09ca9fa61a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_create.py +++ /dev/null @@ -1,1980 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule create", -) -class Create(AAZCommand): - """Create an inbound NAT rule. - - :example: Create a basic inbound NAT rule for port 80. - az network lb inbound-nat-rule create -g MyResourceGroup --lb-name MyLb -n MyNatRule --protocol Tcp --frontend-port 80 --backend-port 80 - - :example: Create a basic inbound NAT rule for a specific frontend IP and enable floating IP for NAT Rule. - az network lb inbound-nat-rule create -g MyResourceGroup --lb-name MyLb -n MyNatRule --protocol Tcp --frontend-port 5432 --backend-port 3389 --frontend-ip MyFrontendIp --floating-ip true - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.inboundNatRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer.", - required=True, - ) - - # define Arg Group "Parameters.properties.inboundNatRules[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _args_schema.enable_floating_ip = AAZBoolArg( - options=["--floating-ip", "--enable-floating-ip"], - arg_group="Properties", - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _args_schema.enable_tcp_reset = AAZBoolArg( - options=["--enable-tcp-reset"], - arg_group="Properties", - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name of ID of the frontend IP configuration.", - ) - _args_schema.frontend_port = AAZIntArg( - options=["--frontend-port"], - arg_group="Properties", - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the load balancing rule.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_delete.py deleted file mode 100644 index ddd2bd0e271..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_delete.py +++ /dev/null @@ -1,1907 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule delete", -) -class Delete(AAZCommand): - """Delete an inbound NAT rule. - - :example: Delete an inbound NAT rule. - az network lb inbound-nat-rule delete -g MyResourceGroup --lb-name MyLb -n MyNatRule - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.inboundNatRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_list.py deleted file mode 100644 index 22b249c2dfc..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_list.py +++ /dev/null @@ -1,1763 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule list", -) -class List(AAZCommand): - """List inbound NAT rules. - - :example: List inbound NAT rules. - az network lb inbound-nat-rule list -g MyResourceGroup --lb-name MyLb - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.inboundNatRules"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.inboundNatRules - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.inboundNatRules = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_show.py deleted file mode 100644 index 89b3397d11d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_show.py +++ /dev/null @@ -1,1782 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule show", -) -class Show(AAZCommand): - """Get the details of an inbound NAT rule. - - :example: Get the details of an inbound NAT rule. - az network lb inbound-nat-rule show -g MyResourceGroup --lb-name MyLb -n MyNatRule - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.inboundNatRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_update.py deleted file mode 100644 index 62bf73c7839..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_update.py +++ /dev/null @@ -1,1996 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule update", -) -class Update(AAZCommand): - """Update an inbound NAT rule. - - :example: Update an inbound NAT rule to disable floating IP and modify idle timeout duration. - az network lb inbound-nat-rule update -g MyResourceGroup --lb-name MyLb -n MyNatRule --floating-ip false --idle-timeout 5 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.inboundNatRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer.", - required=True, - ) - - # define Arg Group "Parameters.properties.inboundNatRules[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - nullable=True, - ) - _args_schema.enable_floating_ip = AAZBoolArg( - options=["--floating-ip", "--enable-floating-ip"], - arg_group="Properties", - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - _args_schema.enable_tcp_reset = AAZBoolArg( - options=["--enable-tcp-reset"], - arg_group="Properties", - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name of ID of the frontend IP configuration.", - nullable=True, - ) - _args_schema.frontend_port = AAZIntArg( - options=["--frontend-port"], - arg_group="Properties", - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - nullable=True, - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the load balancing rule.", - nullable=True, - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.inboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_wait.py deleted file mode 100644 index 42fa736cf64..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/inbound_nat_rule/_wait.py +++ /dev/null @@ -1,1748 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb inbound-nat-rule wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.inboundNatRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/__cmd_group.py deleted file mode 100644 index 1d8dc35f6f5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb outbound-rule", -) -class __CMDGroup(AAZCommandGroup): - """Manage outbound rules of a load balancer. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_create.py deleted file mode 100644 index 64135930b0d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_create.py +++ /dev/null @@ -1,1988 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb outbound-rule create", -) -class Create(AAZCommand): - """Create an outbound-rule. - - :example: Create an outbound-rule. - az network lb outbound-rule create --address-pool MyAddressPool --frontend-ip-configs myfrontendoutbound --idle-timeout 5 --lb-name MyLb --name MyOutboundRule --outbound-ports 10000 --protocol Udp --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.outboundRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the outbound rule.", - required=True, - ) - - # define Arg Group "Parameters.properties.outboundRules[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.allocated_outbound_ports = AAZIntArg( - options=["--outbound-ports", "--allocated-outbound-ports"], - arg_group="Properties", - help="The number of outbound ports to be used for NAT.", - ) - _args_schema.backend_address_pool = AAZStrArg( - options=["--address-pool", "--backend-address-pool"], - arg_group="Properties", - help="The name or ID of the backend address pool.", - ) - _args_schema.enable_tcp_reset = AAZBoolArg( - options=["--enable-tcp-reset"], - arg_group="Properties", - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - ) - _args_schema.frontend_ip_configurations = AAZListArg( - options=["--frontend-ip-configurations"], - arg_group="Properties", - help="The Frontend IP addresses of the load balancer.", - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The protocol for the outbound rule in load balancer.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - frontend_ip_configurations = cls._args_schema.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectArg() - - _element = cls._args_schema.frontend_ip_configurations.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.outboundRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.outboundRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("allocatedOutboundPorts", AAZIntType, ".allocated_outbound_ports") - properties.set_prop("backendAddressPool", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - properties.set_prop("frontendIPConfigurations", AAZListType, ".frontend_ip_configurations", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - backend_address_pool = _builder.get(".properties.backendAddressPool") - if backend_address_pool is not None: - backend_address_pool.set_prop("id", AAZStrType, ".backend_address_pool") - - frontend_ip_configurations = _builder.get(".properties.frontendIPConfigurations") - if frontend_ip_configurations is not None: - frontend_ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.frontendIPConfigurations[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_delete.py deleted file mode 100644 index 76f5bfc39a3..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_delete.py +++ /dev/null @@ -1,1907 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb outbound-rule delete", -) -class Delete(AAZCommand): - """Delete an outbound-rule. - - :example: Delete an outbound-rule. - az az network lb outbound-rule delete --lb-name MyLb --name MyOutboundRule --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.outboundRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the outbound rule.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.outboundRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.outboundRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_list.py deleted file mode 100644 index 26bfbde26be..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_list.py +++ /dev/null @@ -1,1763 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb outbound-rule list", -) -class List(AAZCommand): - """List outbound rules. - - :example: List outbound rules. - az network lb outbound-rule list --lb-name MyLb --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.outboundRules"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.outboundRules - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.outboundRules = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_show.py deleted file mode 100644 index 98fcd0d5cb4..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_show.py +++ /dev/null @@ -1,1782 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb outbound-rule show", -) -class Show(AAZCommand): - """Get the details of an outbound rule. - - :example: Get the details of an outbound rule. - az network lb outbound-rule show --lb-name MyLb --name MyOutboundRule --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.outboundRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the outbound rule.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.outboundRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.outboundRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_update.py deleted file mode 100644 index 326d557d1b5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_update.py +++ /dev/null @@ -1,2007 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb outbound-rule update", -) -class Update(AAZCommand): - """Update an outbound-rule. - - :example: Update an outbound-rule. - az network lb outbound-rule update --lb-name MyLb --name MyOutboundRule --outbound-ports 10000 --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.outboundRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the outbound rule.", - required=True, - ) - - # define Arg Group "Parameters.properties.outboundRules[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.allocated_outbound_ports = AAZIntArg( - options=["--outbound-ports", "--allocated-outbound-ports"], - arg_group="Properties", - help="The number of outbound ports to be used for NAT.", - nullable=True, - ) - _args_schema.backend_address_pool = AAZStrArg( - options=["--address-pool", "--backend-address-pool"], - arg_group="Properties", - help="The name or ID of the backend address pool.", - nullable=True, - ) - _args_schema.enable_tcp_reset = AAZBoolArg( - options=["--enable-tcp-reset"], - arg_group="Properties", - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _args_schema.frontend_ip_configurations = AAZListArg( - options=["--frontend-ip-configurations"], - arg_group="Properties", - help="The Frontend IP addresses of the load balancer.", - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection.", - nullable=True, - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The protocol for the outbound rule in load balancer.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - frontend_ip_configurations = cls._args_schema.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.frontend_ip_configurations.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.outboundRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.outboundRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("allocatedOutboundPorts", AAZIntType, ".allocated_outbound_ports") - properties.set_prop("backendAddressPool", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - properties.set_prop("frontendIPConfigurations", AAZListType, ".frontend_ip_configurations", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - backend_address_pool = _builder.get(".properties.backendAddressPool") - if backend_address_pool is not None: - backend_address_pool.set_prop("id", AAZStrType, ".backend_address_pool") - - frontend_ip_configurations = _builder.get(".properties.frontendIPConfigurations") - if frontend_ip_configurations is not None: - frontend_ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.frontendIPConfigurations[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_wait.py deleted file mode 100644 index 3b1439ce11b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/outbound_rule/_wait.py +++ /dev/null @@ -1,1748 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb outbound-rule wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.outboundRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/__cmd_group.py deleted file mode 100644 index 2cf6c0a3e84..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb probe", -) -class __CMDGroup(AAZCommandGroup): - """Evaluate probe information and define routing rules. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_create.py deleted file mode 100644 index 7be92136749..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_create.py +++ /dev/null @@ -1,1964 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe create", -) -class Create(AAZCommand): - """Create a probe in the load balance. - - :example: Create a probe on a load balancer over HTTP and port 80. - az network lb probe create -g MyResourceGroup --lb-name MyLb -n MyProbe --protocol http --port 80 --path / - - :example: Create a probe on a load balancer over TCP on port 443. - az network lb probe create -g MyResourceGroup --lb-name MyLb -n MyProbe --protocol tcp --port 443 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.probes[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the probe.", - required=True, - ) - - # define Arg Group "Parameters.properties.probes[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.interval_in_seconds = AAZIntArg( - options=["--interval", "--interval-in-seconds"], - arg_group="Properties", - help={"short-summary": "The interval, in seconds, for how frequently to probe the endpoint for health status.", "long-summary": "Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5."}, - ) - _args_schema.number_of_probes = AAZIntArg( - options=["--threshold", "--number-of-probes"], - arg_group="Properties", - help={"short-summary": "The number of consecutive probe failures before an instance is deemed unhealthy.", "long-summary": "This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure."}, - ) - _args_schema.port = AAZIntArg( - options=["--port"], - arg_group="Properties", - help="The port for communicating the probe. Possible values range from 1 to 65535, inclusive.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help={"short-summary": "The protocol of the end point.", "long-summary": "If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful."}, - enum={"Http": "Http", "Https": "Https", "Tcp": "Tcp"}, - ) - _args_schema.request_path = AAZStrArg( - options=["--path", "--request-path"], - arg_group="Properties", - help="The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("intervalInSeconds", AAZIntType, ".interval_in_seconds") - properties.set_prop("numberOfProbes", AAZIntType, ".number_of_probes") - properties.set_prop("port", AAZIntType, ".port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("requestPath", AAZStrType, ".request_path") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_delete.py deleted file mode 100644 index 450bfa488a4..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_delete.py +++ /dev/null @@ -1,1907 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe delete", -) -class Delete(AAZCommand): - """Delete a probe in the load balancer. - - :example: Delete a probe. - az network lb probe delete -g MyResourceGroup --lb-name MyLb -n MyProbe - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.probes[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the probe.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_list.py deleted file mode 100644 index ff631bc1aac..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_list.py +++ /dev/null @@ -1,1763 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe list", -) -class List(AAZCommand): - """List probes in the load balancer. - - :example: List probes - az network lb probe list -g MyResourceGroup --lb-name MyLb - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.probes"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.probes - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.probes = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_show.py deleted file mode 100644 index 8fe6adcf6ec..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_show.py +++ /dev/null @@ -1,1782 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe show", -) -class Show(AAZCommand): - """Get the details of a probe in the load balancer. - - :example: Get the details of a probe. - az network lb probe show -g MyResourceGroup --lb-name MyLb -n MyProbe - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.probes[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the probe.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_update.py deleted file mode 100644 index 3722a991b83..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_update.py +++ /dev/null @@ -1,1976 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe update", -) -class Update(AAZCommand): - """Update a probe in the load balancer. - - :example: Update a probe with a different port and interval. - az network lb probe update -g MyResourceGroup --lb-name MyLb -n MyProbe --port 81 --interval 10 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.probes[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the probe.", - required=True, - ) - - # define Arg Group "Parameters.properties.probes[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.interval_in_seconds = AAZIntArg( - options=["--interval", "--interval-in-seconds"], - arg_group="Properties", - help={"short-summary": "The interval, in seconds, for how frequently to probe the endpoint for health status.", "long-summary": "Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5."}, - nullable=True, - ) - _args_schema.number_of_probes = AAZIntArg( - options=["--threshold", "--number-of-probes"], - arg_group="Properties", - help={"short-summary": "The number of consecutive probe failures before an instance is deemed unhealthy.", "long-summary": "This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure."}, - nullable=True, - ) - _args_schema.port = AAZIntArg( - options=["--port"], - arg_group="Properties", - help="The port for communicating the probe. Possible values range from 1 to 65535, inclusive.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help={"short-summary": "The protocol of the end point.", "long-summary": "If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful."}, - enum={"Http": "Http", "Https": "Https", "Tcp": "Tcp"}, - ) - _args_schema.request_path = AAZStrArg( - options=["--path", "--request-path"], - arg_group="Properties", - help="The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed.", - nullable=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.probes - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("intervalInSeconds", AAZIntType, ".interval_in_seconds") - properties.set_prop("numberOfProbes", AAZIntType, ".number_of_probes") - properties.set_prop("port", AAZIntType, ".port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("requestPath", AAZStrType, ".request_path") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_wait.py deleted file mode 100644 index 82961d40798..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/probe/_wait.py +++ /dev/null @@ -1,1748 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb probe wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.probes[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/__cmd_group.py deleted file mode 100644 index 812e7da7710..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 lb rule", -) -class __CMDGroup(AAZCommandGroup): - """Manage load balancing rules. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_create.py deleted file mode 100644 index ce7b96df904..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_create.py +++ /dev/null @@ -1,2017 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule create", -) -class Create(AAZCommand): - """Create a load balancing rule. - - :example: Create a load balancing rule that assigns a front-facing IP configuration and port to an address pool and port. - az network lb rule create -g MyResourceGroup --lb-name MyLb -n MyLbRule --protocol Tcp --frontend-ip MyFrontEndIp --frontend-port 80 --backend-pool-name MyAddressPool --backend-port 80 - - :example: Create a load balancing rule that assigns a front-facing IP configuration and port to an address pool and port with the floating ip feature. - az network lb rule create -g MyResourceGroup --lb-name MyLb -n MyLbRule --protocol Tcp --frontend-ip MyFrontEndIp --backend-pool-name MyAddressPool --floating-ip true --frontend-port 80 --backend-port 80 - - :example: Create an HA ports load balancing rule that assigns a frontend IP and port to use all available backend IPs in a pool on the same port. - az network lb rule create -g MyResourceGroup --lb-name MyLb -n MyHAPortsRule --protocol All --frontend-port 0 --backend-port 0 --frontend-ip MyFrontendIp --backend-pool-name MyAddressPool - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.loadBalancingRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the load balancing rule.", - required=True, - ) - - # define Arg Group "Parameters.properties.loadBalancingRules[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_address_pool = AAZStrArg( - options=["--backend-pool-name", "--backend-address-pool"], - arg_group="Properties", - help="The name or ID of the backend address pool", - ) - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables \"Any Port\".", - ) - _args_schema.disable_outbound_snat = AAZBoolArg( - options=["--disable-outbound-snat"], - arg_group="Properties", - help="Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule.", - ) - _args_schema.enable_floating_ip = AAZBoolArg( - options=["--floating-ip", "--enable-floating-ip"], - arg_group="Properties", - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _args_schema.enable_tcp_reset = AAZBoolArg( - options=["--enable-tcp-reset"], - arg_group="Properties", - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name of ID of the frontend IP configuration.", - ) - _args_schema.frontend_port = AAZIntArg( - options=["--frontend-port"], - arg_group="Properties", - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables \"Any Port\".", - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _args_schema.load_distribution = AAZStrArg( - options=["--load-distribution"], - arg_group="Properties", - help="The load distribution policy for this rule.", - default="Default", - enum={"Default": "Default", "SourceIP": "SourceIP", "SourceIPProtocol": "SourceIPProtocol"}, - ) - _args_schema.probe_name = AAZStrArg( - options=["--probe", "--probe-name"], - arg_group="Properties", - help="The ID or Name of an existing probe to associate with this rule.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the load balancing rule.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendAddressPool", AAZObjectType) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("disableOutboundSnat", AAZBoolType, ".disable_outbound_snat") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("loadDistribution", AAZStrType, ".load_distribution") - properties.set_prop("probe", AAZObjectType) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - backend_address_pool = _builder.get(".properties.backendAddressPool") - if backend_address_pool is not None: - backend_address_pool.set_prop("id", AAZStrType, ".backend_address_pool") - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - probe = _builder.get(".properties.probe") - if probe is not None: - probe.set_prop("id", AAZStrType, ".probe_name") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_delete.py deleted file mode 100644 index 7a8680d55e3..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_delete.py +++ /dev/null @@ -1,1907 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule delete", -) -class Delete(AAZCommand): - """Delete a load balancing rule. - - :example: Delete a load balancing rule. - az network lb rule delete -g MyResourceGroup --lb-name MyLb -n MyLbRule - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.loadBalancingRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the load balancing rule.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_list.py deleted file mode 100644 index c69ca3f77e2..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_list.py +++ /dev/null @@ -1,1763 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule list", -) -class List(AAZCommand): - """List load balancing rules. - - :example: List load balancing rules. - az network lb rule list -g MyResourceGroup --lb-name MyLb -o table - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.loadBalancingRules"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.loadBalancingRules - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.loadBalancingRules = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_show.py deleted file mode 100644 index 7ac9531dd5c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_show.py +++ /dev/null @@ -1,1782 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule show", -) -class Show(AAZCommand): - """Get the details of a load balancing rule. - - :example: Get the details of a load balancing rule. - az network lb rule show -g MyResourceGroup --lb-name MyLb -n MyLbRule - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.loadBalancingRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the load balancing rule.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_update.py deleted file mode 100644 index 210bc3000e2..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_update.py +++ /dev/null @@ -1,2034 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule update", -) -class Update(AAZCommand): - """Update a load balancing rule. - - :example: Update a load balancing rule to change the protocol to UDP. - az network lb rule update -g MyResourceGroup --lb-name MyLb -n MyLbRule --protocol Udp - - :example: Update a load balancing rule to support HA ports. - az network lb rule update -g MyResourceGroup --lb-name MyLb -n MyLbRule --protocol All --frontend-port 0 --backend-port 0 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.loadBalancingRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the load balancing rule.", - required=True, - ) - - # define Arg Group "Parameters.properties.loadBalancingRules[]" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.backend_address_pool = AAZStrArg( - options=["--backend-pool-name", "--backend-address-pool"], - arg_group="Properties", - help="The name or ID of the backend address pool", - nullable=True, - ) - _args_schema.backend_port = AAZIntArg( - options=["--backend-port"], - arg_group="Properties", - help="The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables \"Any Port\".", - nullable=True, - ) - _args_schema.disable_outbound_snat = AAZBoolArg( - options=["--disable-outbound-snat"], - arg_group="Properties", - help="Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule.", - nullable=True, - ) - _args_schema.enable_floating_ip = AAZBoolArg( - options=["--floating-ip", "--enable-floating-ip"], - arg_group="Properties", - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - _args_schema.enable_tcp_reset = AAZBoolArg( - options=["--enable-tcp-reset"], - arg_group="Properties", - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _args_schema.frontend_ip_name = AAZStrArg( - options=["--frontend-ip", "--frontend-ip-name"], - arg_group="Properties", - help="The name of ID of the frontend IP configuration.", - nullable=True, - ) - _args_schema.frontend_port = AAZIntArg( - options=["--frontend-port"], - arg_group="Properties", - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables \"Any Port\".", - ) - _args_schema.idle_timeout_in_minutes = AAZIntArg( - options=["--idle-timeout", "--idle-timeout-in-minutes"], - arg_group="Properties", - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _args_schema.load_distribution = AAZStrArg( - options=["--load-distribution"], - arg_group="Properties", - help="The load distribution policy for this rule.", - nullable=True, - enum={"Default": "Default", "SourceIP": "SourceIP", "SourceIPProtocol": "SourceIPProtocol"}, - ) - _args_schema.probe_name = AAZStrArg( - options=["--probe", "--probe-name"], - arg_group="Properties", - help="The ID or Name of an existing probe to associate with this rule.", - nullable=True, - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - arg_group="Properties", - help="The reference to the transport protocol used by the load balancing rule.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.LoadBalancersCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.loadBalancingRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LoadBalancersCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_load_balancer_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("backendAddressPool", AAZObjectType) - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("disableOutboundSnat", AAZBoolType, ".disable_outbound_snat") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - properties.set_prop("frontendIPConfiguration", AAZObjectType) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("loadDistribution", AAZStrType, ".load_distribution") - properties.set_prop("probe", AAZObjectType) - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - - backend_address_pool = _builder.get(".properties.backendAddressPool") - if backend_address_pool is not None: - backend_address_pool.set_prop("id", AAZStrType, ".backend_address_pool") - - frontend_ip_configuration = _builder.get(".properties.frontendIPConfiguration") - if frontend_ip_configuration is not None: - frontend_ip_configuration.set_prop("id", AAZStrType, ".frontend_ip_name") - - probe = _builder.get(".properties.probe") - if probe is not None: - probe.set_prop("id", AAZStrType, ".probe_name") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_wait.py deleted file mode 100644 index db943f7b45b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/lb/rule/_wait.py +++ /dev/null @@ -1,1748 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network lb rule wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/loadbalancers/{}", "2018-11-01", "properties.loadBalancingRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="The load balancer name.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LoadBalancersGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LoadBalancersGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "loadBalancerName", self.ctx.args.lb_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_load_balancer_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_backend_address_pool_read = None - - @classmethod - def _build_schema_backend_address_pool_read(cls, _schema): - if cls._schema_backend_address_pool_read is not None: - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - return - - cls._schema_backend_address_pool_read = _schema_backend_address_pool_read = AAZObjectType() - - backend_address_pool_read = _schema_backend_address_pool_read - backend_address_pool_read.etag = AAZStrType() - backend_address_pool_read.id = AAZStrType() - backend_address_pool_read.name = AAZStrType() - backend_address_pool_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_backend_address_pool_read.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_backend_address_pool_read.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_backend_address_pool_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_backend_address_pool_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - _schema.etag = cls._schema_backend_address_pool_read.etag - _schema.id = cls._schema_backend_address_pool_read.id - _schema.name = cls._schema_backend_address_pool_read.name - _schema.properties = cls._schema_backend_address_pool_read.properties - - _schema_frontend_ip_configuration_read = None - - @classmethod - def _build_schema_frontend_ip_configuration_read(cls, _schema): - if cls._schema_frontend_ip_configuration_read is not None: - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - return - - cls._schema_frontend_ip_configuration_read = _schema_frontend_ip_configuration_read = AAZObjectType() - - frontend_ip_configuration_read = _schema_frontend_ip_configuration_read - frontend_ip_configuration_read.etag = AAZStrType() - frontend_ip_configuration_read.id = AAZStrType() - frontend_ip_configuration_read.name = AAZStrType() - frontend_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - frontend_ip_configuration_read.zones = AAZListType() - - properties = _schema_frontend_ip_configuration_read.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_frontend_ip_configuration_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_frontend_ip_configuration_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_frontend_ip_configuration_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_frontend_ip_configuration_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_frontend_ip_configuration_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_frontend_ip_configuration_read.etag - _schema.id = cls._schema_frontend_ip_configuration_read.id - _schema.name = cls._schema_frontend_ip_configuration_read.name - _schema.properties = cls._schema_frontend_ip_configuration_read.properties - _schema.zones = cls._schema_frontend_ip_configuration_read.zones - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_inbound_nat_rule_read = None - - @classmethod - def _build_schema_inbound_nat_rule_read(cls, _schema): - if cls._schema_inbound_nat_rule_read is not None: - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - return - - cls._schema_inbound_nat_rule_read = _schema_inbound_nat_rule_read = AAZObjectType() - - inbound_nat_rule_read = _schema_inbound_nat_rule_read - inbound_nat_rule_read.etag = AAZStrType() - inbound_nat_rule_read.id = AAZStrType() - inbound_nat_rule_read.name = AAZStrType() - inbound_nat_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_inbound_nat_rule_read.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_inbound_nat_rule_read.etag - _schema.id = cls._schema_inbound_nat_rule_read.id - _schema.name = cls._schema_inbound_nat_rule_read.name - _schema.properties = cls._schema_inbound_nat_rule_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_load_balancer_read = None - - @classmethod - def _build_schema_load_balancer_read(cls, _schema): - if cls._schema_load_balancer_read is not None: - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - return - - cls._schema_load_balancer_read = _schema_load_balancer_read = AAZObjectType() - - load_balancer_read = _schema_load_balancer_read - load_balancer_read.etag = AAZStrType() - load_balancer_read.id = AAZStrType() - load_balancer_read.location = AAZStrType() - load_balancer_read.name = AAZStrType( - flags={"read_only": True}, - ) - load_balancer_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - load_balancer_read.sku = AAZObjectType() - load_balancer_read.tags = AAZDictType() - load_balancer_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_load_balancer_read.properties - properties.backend_address_pools = AAZListType( - serialized_name="backendAddressPools", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - ) - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - ) - properties.probes = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - backend_address_pools = _schema_load_balancer_read.properties.backend_address_pools - backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(backend_address_pools.Element) - - frontend_ip_configurations = _schema_load_balancer_read.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_frontend_ip_configuration_read(frontend_ip_configurations.Element) - - inbound_nat_pools = _schema_load_balancer_read.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.inbound_nat_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.inbound_nat_pools.Element.properties - properties.backend_port = AAZIntType( - serialized_name="backendPort", - flags={"required": True}, - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port_range_end = AAZIntType( - serialized_name="frontendPortRangeEnd", - flags={"required": True}, - ) - properties.frontend_port_range_start = AAZIntType( - serialized_name="frontendPortRangeStart", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - inbound_nat_rules = _schema_load_balancer_read.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_load_balancer_read.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.load_balancing_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.load_balancing_rules.Element.properties - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.disable_outbound_snat = AAZBoolType( - serialized_name="disableOutboundSnat", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.load_distribution = AAZStrType( - serialized_name="loadDistribution", - ) - properties.probe = AAZObjectType() - cls._build_schema_sub_resource_read(properties.probe) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - outbound_rules = _schema_load_balancer_read.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.outbound_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.outbound_rules.Element.properties - properties.allocated_outbound_ports = AAZIntType( - serialized_name="allocatedOutboundPorts", - ) - properties.backend_address_pool = AAZObjectType( - serialized_name="backendAddressPool", - flags={"required": True}, - ) - cls._build_schema_sub_resource_read(properties.backend_address_pool) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configurations = AAZListType( - serialized_name="frontendIPConfigurations", - flags={"required": True}, - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - frontend_ip_configurations = _schema_load_balancer_read.properties.outbound_rules.Element.properties.frontend_ip_configurations - frontend_ip_configurations.Element = AAZObjectType() - cls._build_schema_sub_resource_read(frontend_ip_configurations.Element) - - probes = _schema_load_balancer_read.properties.probes - probes.Element = AAZObjectType() - - _element = _schema_load_balancer_read.properties.probes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_load_balancer_read.properties.probes.Element.properties - properties.interval_in_seconds = AAZIntType( - serialized_name="intervalInSeconds", - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.number_of_probes = AAZIntType( - serialized_name="numberOfProbes", - ) - properties.port = AAZIntType( - flags={"required": True}, - ) - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.request_path = AAZStrType( - serialized_name="requestPath", - ) - - load_balancing_rules = _schema_load_balancer_read.properties.probes.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - sku = _schema_load_balancer_read.sku - sku.name = AAZStrType() - - tags = _schema_load_balancer_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_load_balancer_read.etag - _schema.id = cls._schema_load_balancer_read.id - _schema.location = cls._schema_load_balancer_read.location - _schema.name = cls._schema_load_balancer_read.name - _schema.properties = cls._schema_load_balancer_read.properties - _schema.sku = cls._schema_load_balancer_read.sku - _schema.tags = cls._schema_load_balancer_read.tags - _schema.type = cls._schema_load_balancer_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - cls._build_schema_backend_address_pool_read(load_balancer_backend_address_pools.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_inbound_nat_rule_read(load_balancer_inbound_nat_rules.Element) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - cls._build_schema_frontend_ip_configuration_read(properties.destination_load_balancer_front_end_ip_configuration) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/__cmd_group.py deleted file mode 100644 index d8d6d8ce87e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/__cmd_group.py +++ /dev/null @@ -1,26 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 local-gateway", -) -class __CMDGroup(AAZCommandGroup): - """Manage local gateways. - - For more information on local gateways, visit: - https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-cli#localnet. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_create.py deleted file mode 100644 index 9a52a7a14c8..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_create.py +++ /dev/null @@ -1,333 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway create", -) -class Create(AAZCommand): - """Create a local VPN gateway. - - :example: Create a Local Network Gateway to represent your on-premises site. - az network local-gateway create -g MyResourceGroup -n MyLocalGateway --gateway-ip-address 23.99.221.164 --local-address-prefixes 10.0.0.0/24 20.0.0.0/24 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the local network gateway.", - required=True, - fmt=AAZStrArgFormat( - min_length=1, - ), - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "BGP Peering" - - _args_schema = cls._args_schema - _args_schema.asn = AAZIntArg( - options=["--asn"], - arg_group="BGP Peering", - help="Autonomous System Number to use for the BGP settings.", - ) - _args_schema.bgp_peering_address = AAZStrArg( - options=["--bgp-peering-address"], - arg_group="BGP Peering", - help="IP address from the OnPremise VPN's subnet to use for BGP peering.", - ) - _args_schema.peer_weight = AAZIntArg( - options=["--peer-weight"], - arg_group="BGP Peering", - help="Weight (0-100) added to routes learned through BGP peering.", - ) - - # define Arg Group "LocalNetworkAddressSpace" - - _args_schema = cls._args_schema - _args_schema.local_address_prefixes = AAZListArg( - options=["--address-prefixes", "--local-address-prefixes"], - arg_group="LocalNetworkAddressSpace", - help="List of CIDR block prefixes representing the address space of the OnPremise VPN's subnet.", - ) - - local_address_prefixes = cls._args_schema.local_address_prefixes - local_address_prefixes.Element = AAZStrArg() - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - arg_group="Parameters", - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Parameters", - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.gateway_ip_address = AAZStrArg( - options=["--gateway-ip-address"], - arg_group="Properties", - help="Gateway's public IP address. (e.g. 10.1.1.1).", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.LocalNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LocalNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("bgpSettings", AAZObjectType) - properties.set_prop("gatewayIpAddress", AAZStrType, ".gateway_ip_address") - properties.set_prop("localNetworkAddressSpace", AAZObjectType) - - bgp_settings = _builder.get(".properties.bgpSettings") - if bgp_settings is not None: - bgp_settings.set_prop("asn", AAZIntType, ".asn") - bgp_settings.set_prop("bgpPeeringAddress", AAZStrType, ".bgp_peering_address") - bgp_settings.set_prop("peerWeight", AAZIntType, ".peer_weight") - - local_network_address_space = _builder.get(".properties.localNetworkAddressSpace") - if local_network_address_space is not None: - local_network_address_space.set_prop("addressPrefixes", AAZListType, ".local_address_prefixes") - - address_prefixes = _builder.get(".properties.localNetworkAddressSpace.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.location = AAZStrType() - _schema_on_200_201.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200_201.tags = AAZDictType() - _schema_on_200_201.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - bgp_settings = cls._schema_on_200_201.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - local_network_address_space = cls._schema_on_200_201.properties.local_network_address_space - local_network_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200_201.properties.local_network_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - tags = cls._schema_on_200_201.tags - tags.Element = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_delete.py deleted file mode 100644 index f288054f2ed..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_delete.py +++ /dev/null @@ -1,167 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway delete", -) -class Delete(AAZCommand): - """Delete a local VPN gateway. - - In order to delete a Local Network Gateway, you must first delete ALL Connection objects in Azure that are connected to the Gateway. After deleting the Gateway, proceed to delete other resources now not in use. For more information, follow the order of instructions on this page: https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-delete-vnet-gateway-portal - - :example: Delete a Local Network Gateway. - az network local-gateway delete -g MyResourceGroup -n MyLocalGateway - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the local network gateway.", - required=True, - id_part="name", - fmt=AAZStrArgFormat( - min_length=1, - ), - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.LocalNetworkGatewaysDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class LocalNetworkGatewaysDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_list.py deleted file mode 100644 index 0a4a163f5a7..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_list.py +++ /dev/null @@ -1,215 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway list", -) -class List(AAZCommand): - """List all local VPN gateways in a resource group. - - :example: List all local VPN gateways in a resource group. - az network local-gateway list -g MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LocalNetworkGatewaysList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class LocalNetworkGatewaysList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - bgp_settings = cls._schema_on_200.value.Element.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - local_network_address_space = cls._schema_on_200.value.Element.properties.local_network_address_space - local_network_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.value.Element.properties.local_network_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_show.py deleted file mode 100644 index 1b0dc0f839e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_show.py +++ /dev/null @@ -1,218 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway show", -) -class Show(AAZCommand): - """Get the details of a local VPN gateway. - - :example: Get the details of a local VPN gateway. - az network local-gateway show -g MyResourceGroup -n MyLocalGateway - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the local network gateway.", - required=True, - id_part="name", - fmt=AAZStrArgFormat( - min_length=1, - ), - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LocalNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LocalNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - bgp_settings = cls._schema_on_200.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - local_network_address_space = cls._schema_on_200.properties.local_network_address_space - local_network_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.local_network_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_update.py deleted file mode 100644 index 0bc192636b0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_update.py +++ /dev/null @@ -1,483 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway update", -) -class Update(AAZCommand): - """Update a local VPN gateway. - - :example: Update a Local Network Gateway provisioned with a 10.0.0.0/24 address prefix with additional prefixes. - az network local-gateway update -g MyResourceGroup -n MyLocalGateway --address-prefixes 10.0.0.0/24 20.0.0.0/24 30.0.0.0/24 - - :example: Update a local VPN gateway. (autogenerated) - az network local-gateway update --gateway-ip-address 23.99.221.164 --name MyLocalGateway --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the local network gateway.", - required=True, - id_part="name", - fmt=AAZStrArgFormat( - min_length=1, - ), - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - - # define Arg Group "BGP Peering" - - _args_schema = cls._args_schema - _args_schema.asn = AAZIntArg( - options=["--asn"], - arg_group="BGP Peering", - help="Autonomous System Number to use for the BGP settings.", - nullable=True, - ) - _args_schema.bgp_peering_address = AAZStrArg( - options=["--bgp-peering-address"], - arg_group="BGP Peering", - help="IP address from the OnPremise VPN's subnet to use for BGP peering.", - nullable=True, - ) - _args_schema.peer_weight = AAZIntArg( - options=["--peer-weight"], - arg_group="BGP Peering", - help="Weight (0-100) added to routes learned through BGP peering.", - nullable=True, - ) - - # define Arg Group "LocalNetworkAddressSpace" - - _args_schema = cls._args_schema - _args_schema.local_address_prefixes = AAZListArg( - options=["--address-prefixes", "--local-address-prefixes"], - arg_group="LocalNetworkAddressSpace", - help="List of CIDR block prefixes representing the address space of the OnPremise VPN's subnet.", - nullable=True, - ) - - local_address_prefixes = cls._args_schema.local_address_prefixes - local_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Parameters", - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.gateway_ip_address = AAZStrArg( - options=["--gateway-ip-address"], - arg_group="Properties", - help="Gateway's public IP address. (e.g. 10.1.1.1).", - nullable=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LocalNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.LocalNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class LocalNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_local_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class LocalNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_local_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("bgpSettings", AAZObjectType) - properties.set_prop("gatewayIpAddress", AAZStrType, ".gateway_ip_address") - properties.set_prop("localNetworkAddressSpace", AAZObjectType) - - bgp_settings = _builder.get(".properties.bgpSettings") - if bgp_settings is not None: - bgp_settings.set_prop("asn", AAZIntType, ".asn") - bgp_settings.set_prop("bgpPeeringAddress", AAZStrType, ".bgp_peering_address") - bgp_settings.set_prop("peerWeight", AAZIntType, ".peer_weight") - - local_network_address_space = _builder.get(".properties.localNetworkAddressSpace") - if local_network_address_space is not None: - local_network_address_space.set_prop("addressPrefixes", AAZListType, ".local_address_prefixes") - - address_prefixes = _builder.get(".properties.localNetworkAddressSpace.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_local_network_gateway_read = None - - @classmethod - def _build_schema_local_network_gateway_read(cls, _schema): - if cls._schema_local_network_gateway_read is not None: - _schema.etag = cls._schema_local_network_gateway_read.etag - _schema.id = cls._schema_local_network_gateway_read.id - _schema.location = cls._schema_local_network_gateway_read.location - _schema.name = cls._schema_local_network_gateway_read.name - _schema.properties = cls._schema_local_network_gateway_read.properties - _schema.tags = cls._schema_local_network_gateway_read.tags - _schema.type = cls._schema_local_network_gateway_read.type - return - - cls._schema_local_network_gateway_read = _schema_local_network_gateway_read = AAZObjectType() - - local_network_gateway_read = _schema_local_network_gateway_read - local_network_gateway_read.etag = AAZStrType() - local_network_gateway_read.id = AAZStrType() - local_network_gateway_read.location = AAZStrType() - local_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway_read.tags = AAZDictType() - local_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_local_network_gateway_read.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - bgp_settings = _schema_local_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - local_network_address_space = _schema_local_network_gateway_read.properties.local_network_address_space - local_network_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_local_network_gateway_read.properties.local_network_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - tags = _schema_local_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_local_network_gateway_read.etag - _schema.id = cls._schema_local_network_gateway_read.id - _schema.location = cls._schema_local_network_gateway_read.location - _schema.name = cls._schema_local_network_gateway_read.name - _schema.properties = cls._schema_local_network_gateway_read.properties - _schema.tags = cls._schema_local_network_gateway_read.tags - _schema.type = cls._schema_local_network_gateway_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_wait.py deleted file mode 100644 index c9e209b4d7f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/local_gateway/_wait.py +++ /dev/null @@ -1,214 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network local-gateway wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/localnetworkgateways/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the local network gateway.", - required=True, - id_part="name", - fmt=AAZStrArgFormat( - min_length=1, - ), - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.LocalNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class LocalNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "localNetworkGatewayName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - bgp_settings = cls._schema_on_200.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - local_network_address_space = cls._schema_on_200.properties.local_network_address_space - local_network_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.local_network_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/__cmd_group.py deleted file mode 100644 index fc5808be9b0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 nic", -) -class __CMDGroup(AAZCommandGroup): - """Manage network interfaces. - - To learn more about network interfaces in Azure, visit https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-network-interface?tabs=network-interface-portal. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/__init__.py deleted file mode 100644 index 7b725850ba8..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._list_effective_nsg import * -from ._show import * -from ._show_effective_route_table import * -from ._update import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_create.py deleted file mode 100644 index 270deb2569a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_create.py +++ /dev/null @@ -1,4162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic create", -) -class Create(AAZCommand): - """Create a network interface. - - :example: Create a network interface for a specified subnet on a specified virtual network. - az network nic create -g MyResourceGroup --vnet-name MyVnet --subnet MySubnet -n MyNic - - :example: Create a network interface for a specified subnet on a virtual network which allows IP forwarding subject to a network security group. - az network nic create -g MyResourceGroup --vnet-name MyVnet --subnet MySubnet -n MyNic --ip-forwarding --network-security-group MyNsg - - :example: Create a network interface for a specified subnet on a virtual network with network security group and application security groups. - az network nic create -g MyResourceGroup --vnet-name MyVnet --subnet MySubnet -n MyNic --network-security-group MyNsg --application-security-groups Web App - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.accelerated_networking = AAZBoolArg( - options=["--accelerated-networking"], - help="Whether to enable accelerated networking.", - ) - _args_schema.ip_forwarding = AAZBoolArg( - options=["--ip-forwarding"], - help="Whether to enable IP forwarding.", - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "DNS" - - _args_schema = cls._args_schema - _args_schema.dns_servers = AAZListArg( - options=["--dns-servers"], - arg_group="DNS", - help="Space-separated list of DNS server IP addresses.", - ) - _args_schema.internal_dns_name = AAZStrArg( - options=["--internal-dns-name"], - arg_group="DNS", - help="Name of internal DNS label.", - ) - - dns_servers = cls._args_schema.dns_servers - dns_servers.Element = AAZStrArg() - - # define Arg Group "DnsSettings" - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.ip_configurations = AAZListArg( - options=["--ip-configurations"], - arg_group="Properties", - help="A list of IPConfigurations of the network interface.", - ) - _args_schema.nsg = AAZObjectArg( - options=["--nsg"], - arg_group="Properties", - help="The reference to the NetworkSecurityGroup resource.", - ) - - ip_configurations = cls._args_schema.ip_configurations - ip_configurations.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}/ipConfigurations/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.application_gateway_backend_address_pools = AAZListArg( - options=["application-gateway-backend-address-pools"], - help="The reference to ApplicationGatewayBackendAddressPool resource.", - ) - _element.application_security_groups = AAZListArg( - options=["application-security-groups"], - help="Application security groups in which the IP configuration is included.", - ) - _element.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference to LoadBalancerBackendAddressPool resource.", - ) - _element.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - ) - _element.primary = AAZBoolArg( - options=["primary"], - help="Whether this is a primary customer address on the network interface.", - ) - _element.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="Private IP address of the IP configuration.", - ) - _element.private_ip_address_version = AAZStrArg( - options=["private-ip-address-version"], - help="Version of private IP address to use.", - default="IPv4", - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Allocation method of private IP address.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address bound to the IP configuration.", - ) - _element.subnet = AAZObjectArg( - options=["subnet"], - help="Subnet bound to the IP configuration.", - ) - cls._build_args_subnet_create(_element.subnet) - - application_gateway_backend_address_pools = cls._args_schema.ip_configurations.Element.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element.application_gateway_backend_address_pools.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the backend address pool that is unique within an Application Gateway.", - ) - _element.backend_addresses = AAZListArg( - options=["backend-addresses"], - help="Backend addresses.", - ) - - backend_addresses = cls._args_schema.ip_configurations.Element.application_gateway_backend_address_pools.Element.backend_addresses - backend_addresses.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element.application_gateway_backend_address_pools.Element.backend_addresses.Element - _element.fqdn = AAZStrArg( - options=["fqdn"], - help="Fully qualified domain name (FQDN).", - ) - _element.ip_address = AAZStrArg( - options=["ip-address"], - help="IP address.", - ) - - application_security_groups = cls._args_schema.ip_configurations.Element.application_security_groups - application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(application_security_groups.Element) - - load_balancer_backend_address_pools = cls._args_schema.ip_configurations.Element.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element.load_balancer_backend_address_pools.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resource.", - ) - - load_balancer_inbound_nat_rules = cls._args_schema.ip_configurations.Element.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element.load_balancer_inbound_nat_rules.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource.", - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.enable_tcp_reset = AAZBoolArg( - options=["enable-tcp-reset"], - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The reference to the transport protocol used by the load balancing rule.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - public_ip_address = cls._args_schema.ip_configurations.Element.public_ip_address - public_ip_address.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address.ddos_settings = AAZObjectArg( - options=["ddos-settings"], - help="The DDoS protection custom policy associated with the public IP address.", - ) - public_ip_address.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - ) - public_ip_address.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - ) - public_ip_address.ip_address = AAZStrArg( - options=["ip-address"], - help="The IP address associated with the public IP address resource.", - ) - public_ip_address.ip_tags = AAZListArg( - options=["ip-tags"], - help="The list of tags associated with the public IP address.", - ) - public_ip_address.public_ip_address_version = AAZStrArg( - options=["public-ip-address-version"], - help="Version of public IP address.", - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - public_ip_address.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP address allocation method.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address.public_ip_prefix = AAZObjectArg( - options=["public-ip-prefix"], - help="The Public IP Prefix this Public IP Address should be allocated from.", - ) - cls._build_args_sub_resource_create(public_ip_address.public_ip_prefix) - public_ip_address.sku = AAZObjectArg( - options=["sku"], - help="The public IP address SKU.", - ) - public_ip_address.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - public_ip_address.zones = AAZListArg( - options=["zones"], - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - ) - - ddos_settings = cls._args_schema.ip_configurations.Element.public_ip_address.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectArg( - options=["ddos-custom-policy"], - help="The DDoS custom policy associated with the public IP.", - ) - cls._build_args_sub_resource_create(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrArg( - options=["protection-coverage"], - help="The DDoS protection policy customizability of the public IP. Only standard coverage will have the ability to be customized.", - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - - dns_settings = cls._args_schema.ip_configurations.Element.public_ip_address.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="The domain name label. The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="The reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN.", - ) - - ip_tags = cls._args_schema.ip_configurations.Element.public_ip_address.ip_tags - ip_tags.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element.public_ip_address.ip_tags.Element - _element.ip_tag_type = AAZStrArg( - options=["ip-tag-type"], - help="The IP tag type. Example: FirstPartyUsage.", - ) - _element.tag = AAZStrArg( - options=["tag"], - help="The value of the IP tag associated with the public IP. Example: SQL.", - ) - - sku = cls._args_schema.ip_configurations.Element.public_ip_address.sku - sku.name = AAZStrArg( - options=["name"], - help="Name of a public IP address SKU.", - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - - tags = cls._args_schema.ip_configurations.Element.public_ip_address.tags - tags.Element = AAZStrArg() - - zones = cls._args_schema.ip_configurations.Element.public_ip_address.zones - zones.Element = AAZStrArg() - - nsg = cls._args_schema.nsg - nsg.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - nsg.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - nsg.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - nsg.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - security_rules = cls._args_schema.nsg.security_rules - security_rules.Element = AAZObjectArg() - - _element = cls._args_schema.nsg.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - _element.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.", - ) - _element.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - _element.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_schema.nsg.security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_schema.nsg.security_rules.Element.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_schema.nsg.security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_schema.nsg.security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_schema.nsg.security_rules.Element.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_schema.nsg.security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - tags = cls._args_schema.nsg.tags - tags.Element = AAZStrArg() - return cls._args_schema - - _args_application_security_group_create = None - - @classmethod - def _build_args_application_security_group_create(cls, _schema): - if cls._args_application_security_group_create is not None: - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - return - - cls._args_application_security_group_create = AAZObjectArg() - - application_security_group_create = cls._args_application_security_group_create - application_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - - _args_network_interface_ip_configuration_create = None - - @classmethod - def _build_args_network_interface_ip_configuration_create(cls, _schema): - if cls._args_network_interface_ip_configuration_create is not None: - _schema.application_gateway_backend_address_pools = cls._args_network_interface_ip_configuration_create.application_gateway_backend_address_pools - _schema.application_security_groups = cls._args_network_interface_ip_configuration_create.application_security_groups - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_create.name - _schema.primary = cls._args_network_interface_ip_configuration_create.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_create.private_ip_address - _schema.private_ip_address_version = cls._args_network_interface_ip_configuration_create.private_ip_address_version - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_create.private_ip_allocation_method - _schema.public_ip_address = cls._args_network_interface_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_create.subnet - _schema.virtual_network_taps = cls._args_network_interface_ip_configuration_create.virtual_network_taps - return - - cls._args_network_interface_ip_configuration_create = AAZObjectArg() - - network_interface_ip_configuration_create = cls._args_network_interface_ip_configuration_create - network_interface_ip_configuration_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - network_interface_ip_configuration_create.application_gateway_backend_address_pools = AAZListArg( - options=["application-gateway-backend-address-pools"], - help="The reference of ApplicationGatewayBackendAddressPool resource.", - ) - network_interface_ip_configuration_create.application_security_groups = AAZListArg( - options=["application-security-groups"], - help="Application security groups in which the IP configuration is included.", - ) - network_interface_ip_configuration_create.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - ) - network_interface_ip_configuration_create.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - ) - network_interface_ip_configuration_create.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - ) - network_interface_ip_configuration_create.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="Private IP address of the IP configuration.", - ) - network_interface_ip_configuration_create.private_ip_address_version = AAZStrArg( - options=["private-ip-address-version"], - help="Available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.", - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - network_interface_ip_configuration_create.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - network_interface_ip_configuration_create.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address bound to the IP configuration.", - ) - network_interface_ip_configuration_create.subnet = AAZObjectArg( - options=["subnet"], - help="Subnet bound to the IP configuration.", - ) - cls._build_args_subnet_create(network_interface_ip_configuration_create.subnet) - network_interface_ip_configuration_create.virtual_network_taps = AAZListArg( - options=["virtual-network-taps"], - help="The reference to Virtual Network Taps.", - ) - - application_gateway_backend_address_pools = cls._args_network_interface_ip_configuration_create.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_create.application_gateway_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the backend address pool that is unique within an Application Gateway.", - ) - _element.backend_addresses = AAZListArg( - options=["backend-addresses"], - help="Backend addresses", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.type = AAZStrArg( - options=["type"], - help="Type of the resource.", - ) - - backend_addresses = cls._args_network_interface_ip_configuration_create.application_gateway_backend_address_pools.Element.backend_addresses - backend_addresses.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_create.application_gateway_backend_address_pools.Element.backend_addresses.Element - _element.fqdn = AAZStrArg( - options=["fqdn"], - help="Fully qualified domain name (FQDN).", - ) - _element.ip_address = AAZStrArg( - options=["ip-address"], - help="IP address", - ) - - application_security_groups = cls._args_network_interface_ip_configuration_create.application_security_groups - application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(application_security_groups.Element) - - load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.enable_tcp_reset = AAZBoolArg( - options=["enable-tcp-reset"], - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_create(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - public_ip_address = cls._args_network_interface_ip_configuration_create.public_ip_address - public_ip_address.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - public_ip_address.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address.ddos_settings = AAZObjectArg( - options=["ddos-settings"], - help="The DDoS protection custom policy associated with the public IP address.", - ) - public_ip_address.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - ) - public_ip_address.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - ) - public_ip_address.ip_address = AAZStrArg( - options=["ip-address"], - help="The IP address associated with the public IP address resource.", - ) - public_ip_address.ip_tags = AAZListArg( - options=["ip-tags"], - help="The list of tags associated with the public IP address.", - ) - public_ip_address.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - public_ip_address.public_ip_address_version = AAZStrArg( - options=["public-ip-address-version"], - help="The public IP address version. Possible values are: 'IPv4' and 'IPv6'.", - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - public_ip_address.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address.public_ip_prefix = AAZObjectArg( - options=["public-ip-prefix"], - help="The Public IP Prefix this Public IP Address should be allocated from.", - ) - cls._build_args_sub_resource_create(public_ip_address.public_ip_prefix) - public_ip_address.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - ) - public_ip_address.sku = AAZObjectArg( - options=["sku"], - help="The public IP address SKU.", - ) - public_ip_address.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - public_ip_address.zones = AAZListArg( - options=["zones"], - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - ) - - ddos_settings = cls._args_network_interface_ip_configuration_create.public_ip_address.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectArg( - options=["ddos-custom-policy"], - help="The DDoS custom policy associated with the public IP.", - ) - cls._build_args_sub_resource_create(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrArg( - options=["protection-coverage"], - help="The DDoS protection policy customizability of the public IP. Only standard coverage will have the ability to be customized.", - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - - dns_settings = cls._args_network_interface_ip_configuration_create.public_ip_address.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - ) - - ip_tags = cls._args_network_interface_ip_configuration_create.public_ip_address.ip_tags - ip_tags.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_create.public_ip_address.ip_tags.Element - _element.ip_tag_type = AAZStrArg( - options=["ip-tag-type"], - help="Gets or sets the ipTag type: Example FirstPartyUsage.", - ) - _element.tag = AAZStrArg( - options=["tag"], - help="Gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc", - ) - - sku = cls._args_network_interface_ip_configuration_create.public_ip_address.sku - sku.name = AAZStrArg( - options=["name"], - help="Name of a public IP address SKU.", - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - - tags = cls._args_network_interface_ip_configuration_create.public_ip_address.tags - tags.Element = AAZStrArg() - - zones = cls._args_network_interface_ip_configuration_create.public_ip_address.zones - zones.Element = AAZStrArg() - - virtual_network_taps = cls._args_network_interface_ip_configuration_create.virtual_network_taps - virtual_network_taps.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_create.virtual_network_taps.Element - _element.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkTaps/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.destination_load_balancer_front_end_ip_configuration = AAZObjectArg( - options=["destination-load-balancer-front-end-ip-configuration"], - help="The reference to the private IP address on the internal Load Balancer that will receive the tap", - ) - _element.destination_network_interface_ip_configuration = AAZObjectArg( - options=["destination-network-interface-ip-configuration"], - help="The reference to the private IP Address of the collector nic that will receive the tap", - ) - cls._build_args_network_interface_ip_configuration_create(_element.destination_network_interface_ip_configuration) - _element.destination_port = AAZIntArg( - options=["destination-port"], - help="The VXLAN destination port that will receive the tapped traffic.", - ) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - destination_load_balancer_front_end_ip_configuration = cls._args_network_interface_ip_configuration_create.virtual_network_taps.Element.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - destination_load_balancer_front_end_ip_configuration.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/frontendIPConfigurations/{}", - ), - ) - destination_load_balancer_front_end_ip_configuration.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - destination_load_balancer_front_end_ip_configuration.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="The private IP address of the IP configuration.", - ) - destination_load_balancer_front_end_ip_configuration.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The Private IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - destination_load_balancer_front_end_ip_configuration.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - destination_load_balancer_front_end_ip_configuration.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference of the Public IP resource.", - ) - cls._build_args_public_ip_address_create(destination_load_balancer_front_end_ip_configuration.public_ip_address) - destination_load_balancer_front_end_ip_configuration.public_ip_prefix = AAZObjectArg( - options=["public-ip-prefix"], - help="The reference of the Public IP Prefix resource.", - ) - cls._build_args_sub_resource_create(destination_load_balancer_front_end_ip_configuration.public_ip_prefix) - destination_load_balancer_front_end_ip_configuration.subnet = AAZObjectArg( - options=["subnet"], - help="The reference of the subnet resource.", - ) - cls._build_args_subnet_create(destination_load_balancer_front_end_ip_configuration.subnet) - destination_load_balancer_front_end_ip_configuration.zones = AAZListArg( - options=["zones"], - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - ) - - zones = cls._args_network_interface_ip_configuration_create.virtual_network_taps.Element.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrArg() - - tags = cls._args_network_interface_ip_configuration_create.virtual_network_taps.Element.tags - tags.Element = AAZStrArg() - - _schema.application_gateway_backend_address_pools = cls._args_network_interface_ip_configuration_create.application_gateway_backend_address_pools - _schema.application_security_groups = cls._args_network_interface_ip_configuration_create.application_security_groups - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_create.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_create.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_create.name - _schema.primary = cls._args_network_interface_ip_configuration_create.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_create.private_ip_address - _schema.private_ip_address_version = cls._args_network_interface_ip_configuration_create.private_ip_address_version - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_create.private_ip_allocation_method - _schema.public_ip_address = cls._args_network_interface_ip_configuration_create.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_create.subnet - _schema.virtual_network_taps = cls._args_network_interface_ip_configuration_create.virtual_network_taps - - _args_network_security_group_create = None - - @classmethod - def _build_args_network_security_group_create(cls, _schema): - if cls._args_network_security_group_create is not None: - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.id = cls._args_network_security_group_create.id - _schema.location = cls._args_network_security_group_create.location - _schema.provisioning_state = cls._args_network_security_group_create.provisioning_state - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.tags = cls._args_network_security_group_create.tags - return - - cls._args_network_security_group_create = AAZObjectArg() - - network_security_group_create = cls._args_network_security_group_create - network_security_group_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_create.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - network_security_group_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - network_security_group_create.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - network_security_group_create.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_network_security_group_create.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_create(default_security_rules.Element) - - security_rules = cls._args_network_security_group_create.security_rules - security_rules.Element = AAZObjectArg() - - _element = cls._args_network_security_group_create.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - _element.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - _element.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - _element.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - _element.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - _element.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_network_security_group_create.security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_network_security_group_create.security_rules.Element.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_network_security_group_create.security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_network_security_group_create.security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_network_security_group_create.security_rules.Element.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_network_security_group_create.security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - tags = cls._args_network_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.default_security_rules = cls._args_network_security_group_create.default_security_rules - _schema.etag = cls._args_network_security_group_create.etag - _schema.id = cls._args_network_security_group_create.id - _schema.location = cls._args_network_security_group_create.location - _schema.provisioning_state = cls._args_network_security_group_create.provisioning_state - _schema.resource_guid = cls._args_network_security_group_create.resource_guid - _schema.security_rules = cls._args_network_security_group_create.security_rules - _schema.tags = cls._args_network_security_group_create.tags - - _args_public_ip_address_create = None - - @classmethod - def _build_args_public_ip_address_create(cls, _schema): - if cls._args_public_ip_address_create is not None: - _schema.ddos_settings = cls._args_public_ip_address_create.ddos_settings - _schema.dns_settings = cls._args_public_ip_address_create.dns_settings - _schema.etag = cls._args_public_ip_address_create.etag - _schema.id = cls._args_public_ip_address_create.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_create.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_create.ip_address - _schema.ip_tags = cls._args_public_ip_address_create.ip_tags - _schema.location = cls._args_public_ip_address_create.location - _schema.provisioning_state = cls._args_public_ip_address_create.provisioning_state - _schema.public_ip_address_version = cls._args_public_ip_address_create.public_ip_address_version - _schema.public_ip_allocation_method = cls._args_public_ip_address_create.public_ip_allocation_method - _schema.public_ip_prefix = cls._args_public_ip_address_create.public_ip_prefix - _schema.resource_guid = cls._args_public_ip_address_create.resource_guid - _schema.sku = cls._args_public_ip_address_create.sku - _schema.tags = cls._args_public_ip_address_create.tags - _schema.zones = cls._args_public_ip_address_create.zones - return - - cls._args_public_ip_address_create = AAZObjectArg() - - public_ip_address_create = cls._args_public_ip_address_create - public_ip_address_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - public_ip_address_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_create.ddos_settings = AAZObjectArg( - options=["ddos-settings"], - help="The DDoS protection custom policy associated with the public IP address.", - ) - public_ip_address_create.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - ) - public_ip_address_create.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - ) - public_ip_address_create.ip_address = AAZStrArg( - options=["ip-address"], - help="The IP address associated with the public IP address resource.", - ) - public_ip_address_create.ip_tags = AAZListArg( - options=["ip-tags"], - help="The list of tags associated with the public IP address.", - ) - public_ip_address_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - public_ip_address_create.public_ip_address_version = AAZStrArg( - options=["public-ip-address-version"], - help="The public IP address version. Possible values are: 'IPv4' and 'IPv6'.", - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - public_ip_address_create.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_create.public_ip_prefix = AAZObjectArg( - options=["public-ip-prefix"], - help="The Public IP Prefix this Public IP Address should be allocated from.", - ) - cls._build_args_sub_resource_create(public_ip_address_create.public_ip_prefix) - public_ip_address_create.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - ) - public_ip_address_create.sku = AAZObjectArg( - options=["sku"], - help="The public IP address SKU.", - ) - public_ip_address_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - public_ip_address_create.zones = AAZListArg( - options=["zones"], - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - ) - - ddos_settings = cls._args_public_ip_address_create.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectArg( - options=["ddos-custom-policy"], - help="The DDoS custom policy associated with the public IP.", - ) - cls._build_args_sub_resource_create(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrArg( - options=["protection-coverage"], - help="The DDoS protection policy customizability of the public IP. Only standard coverage will have the ability to be customized.", - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - - dns_settings = cls._args_public_ip_address_create.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - ) - - ip_tags = cls._args_public_ip_address_create.ip_tags - ip_tags.Element = AAZObjectArg() - - _element = cls._args_public_ip_address_create.ip_tags.Element - _element.ip_tag_type = AAZStrArg( - options=["ip-tag-type"], - help="Gets or sets the ipTag type: Example FirstPartyUsage.", - ) - _element.tag = AAZStrArg( - options=["tag"], - help="Gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc", - ) - - sku = cls._args_public_ip_address_create.sku - sku.name = AAZStrArg( - options=["name"], - help="Name of a public IP address SKU.", - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - - tags = cls._args_public_ip_address_create.tags - tags.Element = AAZStrArg() - - zones = cls._args_public_ip_address_create.zones - zones.Element = AAZStrArg() - - _schema.ddos_settings = cls._args_public_ip_address_create.ddos_settings - _schema.dns_settings = cls._args_public_ip_address_create.dns_settings - _schema.etag = cls._args_public_ip_address_create.etag - _schema.id = cls._args_public_ip_address_create.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_create.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_create.ip_address - _schema.ip_tags = cls._args_public_ip_address_create.ip_tags - _schema.location = cls._args_public_ip_address_create.location - _schema.provisioning_state = cls._args_public_ip_address_create.provisioning_state - _schema.public_ip_address_version = cls._args_public_ip_address_create.public_ip_address_version - _schema.public_ip_allocation_method = cls._args_public_ip_address_create.public_ip_allocation_method - _schema.public_ip_prefix = cls._args_public_ip_address_create.public_ip_prefix - _schema.resource_guid = cls._args_public_ip_address_create.resource_guid - _schema.sku = cls._args_public_ip_address_create.sku - _schema.tags = cls._args_public_ip_address_create.tags - _schema.zones = cls._args_public_ip_address_create.zones - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - security_rule_create.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - security_rule_create.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_create.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - - _args_sub_resource_create = None - - @classmethod - def _build_args_sub_resource_create(cls, _schema): - if cls._args_sub_resource_create is not None: - _schema.id = cls._args_sub_resource_create.id - return - - cls._args_sub_resource_create = AAZObjectArg() - - sub_resource_create = cls._args_sub_resource_create - sub_resource_create.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - - _schema.id = cls._args_sub_resource_create.id - - _args_subnet_create = None - - @classmethod - def _build_args_subnet_create(cls, _schema): - if cls._args_subnet_create is not None: - _schema.address_prefix = cls._args_subnet_create.address_prefix - _schema.address_prefixes = cls._args_subnet_create.address_prefixes - _schema.delegations = cls._args_subnet_create.delegations - _schema.id = cls._args_subnet_create.id - _schema.name = cls._args_subnet_create.name - _schema.network_security_group = cls._args_subnet_create.network_security_group - _schema.resource_navigation_links = cls._args_subnet_create.resource_navigation_links - _schema.route_table = cls._args_subnet_create.route_table - _schema.service_association_links = cls._args_subnet_create.service_association_links - _schema.service_endpoint_policies = cls._args_subnet_create.service_endpoint_policies - _schema.service_endpoints = cls._args_subnet_create.service_endpoints - return - - cls._args_subnet_create = AAZObjectArg() - - subnet_create = cls._args_subnet_create - subnet_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}", - ), - ) - subnet_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - subnet_create.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - subnet_create.address_prefixes = AAZListArg( - options=["address-prefixes"], - help="List of address prefixes for the subnet.", - ) - subnet_create.delegations = AAZListArg( - options=["delegations"], - help="Gets an array of references to the delegations on the subnet.", - ) - subnet_create.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_create(subnet_create.network_security_group) - subnet_create.resource_navigation_links = AAZListArg( - options=["resource-navigation-links"], - help="Gets an array of references to the external resources using subnet.", - ) - subnet_create.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - ) - subnet_create.service_association_links = AAZListArg( - options=["service-association-links"], - help="Gets an array of references to services injecting into this subnet.", - ) - subnet_create.service_endpoint_policies = AAZListArg( - options=["service-endpoint-policies"], - help="An array of service endpoint policies.", - ) - subnet_create.service_endpoints = AAZListArg( - options=["service-endpoints"], - help="An array of service endpoints.", - ) - - address_prefixes = cls._args_subnet_create.address_prefixes - address_prefixes.Element = AAZStrArg() - - delegations = cls._args_subnet_create.delegations - delegations.Element = AAZObjectArg() - - _element = cls._args_subnet_create.delegations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a subnet. This name can be used to access the resource.", - ) - _element.actions = AAZListArg( - options=["actions"], - help="Describes the actions permitted to the service upon delegation", - ) - _element.service_name = AAZStrArg( - options=["service-name"], - help="The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers)", - ) - - actions = cls._args_subnet_create.delegations.Element.actions - actions.Element = AAZStrArg() - - resource_navigation_links = cls._args_subnet_create.resource_navigation_links - resource_navigation_links.Element = AAZObjectArg() - - _element = cls._args_subnet_create.resource_navigation_links.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.link = AAZStrArg( - options=["link"], - help="Link to the external resource", - ) - _element.linked_resource_type = AAZStrArg( - options=["linked-resource-type"], - help="Resource type of the linked resource.", - ) - - route_table = cls._args_subnet_create.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.disable_bgp_route_propagation = AAZBoolArg( - options=["disable-bgp-route-propagation"], - help="Gets or sets whether to disable the routes learned by BGP on that route table. True means disable.", - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_subnet_create.route_table.routes - routes.Element = AAZObjectArg() - - _element = cls._args_subnet_create.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - tags = cls._args_subnet_create.route_table.tags - tags.Element = AAZStrArg() - - service_association_links = cls._args_subnet_create.service_association_links - service_association_links.Element = AAZObjectArg() - - _element = cls._args_subnet_create.service_association_links.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.link = AAZStrArg( - options=["link"], - help="Link to the external resource.", - ) - _element.linked_resource_type = AAZStrArg( - options=["linked-resource-type"], - help="Resource type of the linked resource.", - ) - - service_endpoint_policies = cls._args_subnet_create.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectArg() - - _element = cls._args_subnet_create.service_endpoint_policies.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.service_endpoint_policy_definitions = AAZListArg( - options=["service-endpoint-policy-definitions"], - help="A collection of service endpoint policy definitions of the service endpoint policy.", - ) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - service_endpoint_policy_definitions = cls._args_subnet_create.service_endpoint_policies.Element.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectArg() - - _element = cls._args_subnet_create.service_endpoint_policies.Element.service_endpoint_policy_definitions.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}/serviceEndpointPolicyDefinitions/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.service = AAZStrArg( - options=["service"], - help="service endpoint name.", - ) - _element.service_resources = AAZListArg( - options=["service-resources"], - help="A list of service resources.", - ) - - service_resources = cls._args_subnet_create.service_endpoint_policies.Element.service_endpoint_policy_definitions.Element.service_resources - service_resources.Element = AAZStrArg() - - tags = cls._args_subnet_create.service_endpoint_policies.Element.tags - tags.Element = AAZStrArg() - - service_endpoints = cls._args_subnet_create.service_endpoints - service_endpoints.Element = AAZObjectArg() - - _element = cls._args_subnet_create.service_endpoints.Element - _element.locations = AAZListArg( - options=["locations"], - help="A list of locations.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - ) - _element.service = AAZStrArg( - options=["service"], - help="The type of the endpoint service.", - ) - - locations = cls._args_subnet_create.service_endpoints.Element.locations - locations.Element = AAZStrArg() - - _schema.address_prefix = cls._args_subnet_create.address_prefix - _schema.address_prefixes = cls._args_subnet_create.address_prefixes - _schema.delegations = cls._args_subnet_create.delegations - _schema.id = cls._args_subnet_create.id - _schema.name = cls._args_subnet_create.name - _schema.network_security_group = cls._args_subnet_create.network_security_group - _schema.resource_navigation_links = cls._args_subnet_create.resource_navigation_links - _schema.route_table = cls._args_subnet_create.route_table - _schema.service_association_links = cls._args_subnet_create.service_association_links - _schema.service_endpoint_policies = cls._args_subnet_create.service_endpoint_policies - _schema.service_endpoints = cls._args_subnet_create.service_endpoints - - _args_virtual_network_tap_create = None - - @classmethod - def _build_args_virtual_network_tap_create(cls, _schema): - if cls._args_virtual_network_tap_create is not None: - _schema.destination_load_balancer_front_end_ip_configuration = cls._args_virtual_network_tap_create.destination_load_balancer_front_end_ip_configuration - _schema.destination_network_interface_ip_configuration = cls._args_virtual_network_tap_create.destination_network_interface_ip_configuration - _schema.destination_port = cls._args_virtual_network_tap_create.destination_port - _schema.etag = cls._args_virtual_network_tap_create.etag - _schema.id = cls._args_virtual_network_tap_create.id - _schema.location = cls._args_virtual_network_tap_create.location - _schema.tags = cls._args_virtual_network_tap_create.tags - return - - cls._args_virtual_network_tap_create = AAZObjectArg() - - virtual_network_tap_create = cls._args_virtual_network_tap_create - virtual_network_tap_create.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - virtual_network_tap_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkTaps/{}", - ), - ) - virtual_network_tap_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - virtual_network_tap_create.destination_load_balancer_front_end_ip_configuration = AAZObjectArg( - options=["destination-load-balancer-front-end-ip-configuration"], - help="The reference to the private IP address on the internal Load Balancer that will receive the tap", - ) - virtual_network_tap_create.destination_network_interface_ip_configuration = AAZObjectArg( - options=["destination-network-interface-ip-configuration"], - help="The reference to the private IP Address of the collector nic that will receive the tap", - ) - cls._build_args_network_interface_ip_configuration_create(virtual_network_tap_create.destination_network_interface_ip_configuration) - virtual_network_tap_create.destination_port = AAZIntArg( - options=["destination-port"], - help="The VXLAN destination port that will receive the tapped traffic.", - ) - virtual_network_tap_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - destination_load_balancer_front_end_ip_configuration = cls._args_virtual_network_tap_create.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - destination_load_balancer_front_end_ip_configuration.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/frontendIPConfigurations/{}", - ), - ) - destination_load_balancer_front_end_ip_configuration.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - destination_load_balancer_front_end_ip_configuration.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="The private IP address of the IP configuration.", - ) - destination_load_balancer_front_end_ip_configuration.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The Private IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - destination_load_balancer_front_end_ip_configuration.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - destination_load_balancer_front_end_ip_configuration.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference of the Public IP resource.", - ) - cls._build_args_public_ip_address_create(destination_load_balancer_front_end_ip_configuration.public_ip_address) - destination_load_balancer_front_end_ip_configuration.public_ip_prefix = AAZObjectArg( - options=["public-ip-prefix"], - help="The reference of the Public IP Prefix resource.", - ) - cls._build_args_sub_resource_create(destination_load_balancer_front_end_ip_configuration.public_ip_prefix) - destination_load_balancer_front_end_ip_configuration.subnet = AAZObjectArg( - options=["subnet"], - help="The reference of the subnet resource.", - ) - cls._build_args_subnet_create(destination_load_balancer_front_end_ip_configuration.subnet) - destination_load_balancer_front_end_ip_configuration.zones = AAZListArg( - options=["zones"], - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - ) - - zones = cls._args_virtual_network_tap_create.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrArg() - - tags = cls._args_virtual_network_tap_create.tags - tags.Element = AAZStrArg() - - _schema.destination_load_balancer_front_end_ip_configuration = cls._args_virtual_network_tap_create.destination_load_balancer_front_end_ip_configuration - _schema.destination_network_interface_ip_configuration = cls._args_virtual_network_tap_create.destination_network_interface_ip_configuration - _schema.destination_port = cls._args_virtual_network_tap_create.destination_port - _schema.etag = cls._args_virtual_network_tap_create.etag - _schema.id = cls._args_virtual_network_tap_create.id - _schema.location = cls._args_virtual_network_tap_create.location - _schema.tags = cls._args_virtual_network_tap_create.tags - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType) - properties.set_prop("enableAcceleratedNetworking", AAZBoolType, ".accelerated_networking") - properties.set_prop("enableIPForwarding", AAZBoolType, ".ip_forwarding") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("networkSecurityGroup", AAZObjectType, ".nsg") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name") - - dns_servers = _builder.get(".properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("applicationGatewayBackendAddressPools", AAZListType, ".application_gateway_backend_address_pools") - properties.set_prop("applicationSecurityGroups", AAZListType, ".application_security_groups") - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAddressVersion", AAZStrType, ".private_ip_address_version") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address") - _CreateHelper._build_schema_subnet_create(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - application_gateway_backend_address_pools = _builder.get(".properties.ipConfigurations[].properties.applicationGatewayBackendAddressPools") - if application_gateway_backend_address_pools is not None: - application_gateway_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.applicationGatewayBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.applicationGatewayBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("backendAddresses", AAZListType, ".backend_addresses") - - backend_addresses = _builder.get(".properties.ipConfigurations[].properties.applicationGatewayBackendAddressPools[].properties.backendAddresses") - if backend_addresses is not None: - backend_addresses.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.applicationGatewayBackendAddressPools[].properties.backendAddresses[]") - if _elements is not None: - _elements.set_prop("fqdn", AAZStrType, ".fqdn") - _elements.set_prop("ipAddress", AAZStrType, ".ip_address") - - application_security_groups = _builder.get(".properties.ipConfigurations[].properties.applicationSecurityGroups") - if application_security_groups is not None: - _CreateHelper._build_schema_application_security_group_create(application_security_groups.set_elements(AAZObjectType, ".")) - - load_balancer_backend_address_pools = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - load_balancer_inbound_nat_rules = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - - public_ip_address = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".id") - public_ip_address.set_prop("location", AAZStrType, ".location") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - public_ip_address.set_prop("sku", AAZObjectType, ".sku") - public_ip_address.set_prop("tags", AAZDictType, ".tags") - public_ip_address.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties") - if properties is not None: - properties.set_prop("ddosSettings", AAZObjectType, ".ddos_settings") - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("ipTags", AAZListType, ".ip_tags") - properties.set_prop("publicIPAddressVersion", AAZStrType, ".public_ip_address_version") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - _CreateHelper._build_schema_sub_resource_create(properties.set_prop("publicIPPrefix", AAZObjectType, ".public_ip_prefix")) - - ddos_settings = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties.ddosSettings") - if ddos_settings is not None: - _CreateHelper._build_schema_sub_resource_create(ddos_settings.set_prop("ddosCustomPolicy", AAZObjectType, ".ddos_custom_policy")) - ddos_settings.set_prop("protectionCoverage", AAZStrType, ".protection_coverage") - - dns_settings = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - ip_tags = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties.ipTags") - if ip_tags is not None: - ip_tags.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.properties.ipTags[]") - if _elements is not None: - _elements.set_prop("ipTagType", AAZStrType, ".ip_tag_type") - _elements.set_prop("tag", AAZStrType, ".tag") - - sku = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".name") - - tags = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - zones = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress.zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - network_security_group = _builder.get(".properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("id", AAZStrType, ".id") - network_security_group.set_prop("location", AAZStrType, ".location") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - network_security_group.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkSecurityGroup.properties") - if properties is not None: - properties.set_prop("securityRules", AAZListType, ".security_rules") - - security_rules = _builder.get(".properties.networkSecurityGroup.properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkSecurityGroup.properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - _CreateHelper._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - _CreateHelper._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.networkSecurityGroup.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_application_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_interface_ip_configuration_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("applicationGatewayBackendAddressPools", AAZListType, ".application_gateway_backend_address_pools") - properties.set_prop("applicationSecurityGroups", AAZListType, ".application_security_groups") - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAddressVersion", AAZStrType, ".private_ip_address_version") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address") - cls._build_schema_subnet_create(properties.set_prop("subnet", AAZObjectType, ".subnet")) - properties.set_prop("virtualNetworkTaps", AAZListType, ".virtual_network_taps") - - application_gateway_backend_address_pools = _builder.get(".properties.applicationGatewayBackendAddressPools") - if application_gateway_backend_address_pools is not None: - application_gateway_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationGatewayBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("type", AAZStrType, ".type") - - properties = _builder.get(".properties.applicationGatewayBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("backendAddresses", AAZListType, ".backend_addresses") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - backend_addresses = _builder.get(".properties.applicationGatewayBackendAddressPools[].properties.backendAddresses") - if backend_addresses is not None: - backend_addresses.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationGatewayBackendAddressPools[].properties.backendAddresses[]") - if _elements is not None: - _elements.set_prop("fqdn", AAZStrType, ".fqdn") - _elements.set_prop("ipAddress", AAZStrType, ".ip_address") - - application_security_groups = _builder.get(".properties.applicationSecurityGroups") - if application_security_groups is not None: - cls._build_schema_application_security_group_create(application_security_groups.set_elements(AAZObjectType, ".")) - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - cls._build_schema_sub_resource_create(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - public_ip_address = _builder.get(".properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("etag", AAZStrType, ".etag") - public_ip_address.set_prop("id", AAZStrType, ".id") - public_ip_address.set_prop("location", AAZStrType, ".location") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - public_ip_address.set_prop("sku", AAZObjectType, ".sku") - public_ip_address.set_prop("tags", AAZDictType, ".tags") - public_ip_address.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties.publicIPAddress.properties") - if properties is not None: - properties.set_prop("ddosSettings", AAZObjectType, ".ddos_settings") - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("ipTags", AAZListType, ".ip_tags") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAddressVersion", AAZStrType, ".public_ip_address_version") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - cls._build_schema_sub_resource_create(properties.set_prop("publicIPPrefix", AAZObjectType, ".public_ip_prefix")) - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - ddos_settings = _builder.get(".properties.publicIPAddress.properties.ddosSettings") - if ddos_settings is not None: - cls._build_schema_sub_resource_create(ddos_settings.set_prop("ddosCustomPolicy", AAZObjectType, ".ddos_custom_policy")) - ddos_settings.set_prop("protectionCoverage", AAZStrType, ".protection_coverage") - - dns_settings = _builder.get(".properties.publicIPAddress.properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - ip_tags = _builder.get(".properties.publicIPAddress.properties.ipTags") - if ip_tags is not None: - ip_tags.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.publicIPAddress.properties.ipTags[]") - if _elements is not None: - _elements.set_prop("ipTagType", AAZStrType, ".ip_tag_type") - _elements.set_prop("tag", AAZStrType, ".tag") - - sku = _builder.get(".properties.publicIPAddress.sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".name") - - tags = _builder.get(".properties.publicIPAddress.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - zones = _builder.get(".properties.publicIPAddress.zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - virtual_network_taps = _builder.get(".properties.virtualNetworkTaps") - if virtual_network_taps is not None: - virtual_network_taps.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.virtualNetworkTaps[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.virtualNetworkTaps[].properties") - if properties is not None: - properties.set_prop("destinationLoadBalancerFrontEndIPConfiguration", AAZObjectType, ".destination_load_balancer_front_end_ip_configuration") - cls._build_schema_network_interface_ip_configuration_create(properties.set_prop("destinationNetworkInterfaceIPConfiguration", AAZObjectType, ".destination_network_interface_ip_configuration")) - properties.set_prop("destinationPort", AAZIntType, ".destination_port") - - destination_load_balancer_front_end_ip_configuration = _builder.get(".properties.virtualNetworkTaps[].properties.destinationLoadBalancerFrontEndIPConfiguration") - if destination_load_balancer_front_end_ip_configuration is not None: - destination_load_balancer_front_end_ip_configuration.set_prop("etag", AAZStrType, ".etag") - destination_load_balancer_front_end_ip_configuration.set_prop("id", AAZStrType, ".id") - destination_load_balancer_front_end_ip_configuration.set_prop("name", AAZStrType, ".name") - destination_load_balancer_front_end_ip_configuration.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - destination_load_balancer_front_end_ip_configuration.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties.virtualNetworkTaps[].properties.destinationLoadBalancerFrontEndIPConfiguration.properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_create(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_sub_resource_create(properties.set_prop("publicIPPrefix", AAZObjectType, ".public_ip_prefix")) - cls._build_schema_subnet_create(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - zones = _builder.get(".properties.virtualNetworkTaps[].properties.destinationLoadBalancerFrontEndIPConfiguration.zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.virtualNetworkTaps[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_create(default_security_rules.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.securityRules[].properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.securityRules[].properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.securityRules[].properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.securityRules[].properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.securityRules[].properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.securityRules[].properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("sku", AAZObjectType, ".sku") - _builder.set_prop("tags", AAZDictType, ".tags") - _builder.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("ddosSettings", AAZObjectType, ".ddos_settings") - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("ipTags", AAZListType, ".ip_tags") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAddressVersion", AAZStrType, ".public_ip_address_version") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - cls._build_schema_sub_resource_create(properties.set_prop("publicIPPrefix", AAZObjectType, ".public_ip_prefix")) - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - ddos_settings = _builder.get(".properties.ddosSettings") - if ddos_settings is not None: - cls._build_schema_sub_resource_create(ddos_settings.set_prop("ddosCustomPolicy", AAZObjectType, ".ddos_custom_policy")) - ddos_settings.set_prop("protectionCoverage", AAZStrType, ".protection_coverage") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - ip_tags = _builder.get(".properties.ipTags") - if ip_tags is not None: - ip_tags.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipTags[]") - if _elements is not None: - _elements.set_prop("ipTagType", AAZStrType, ".ip_tag_type") - _elements.set_prop("tag", AAZStrType, ".tag") - - sku = _builder.get(".sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".name") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - zones = _builder.get(".zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_sub_resource_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - properties.set_prop("delegations", AAZListType, ".delegations") - cls._build_schema_network_security_group_create(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("resourceNavigationLinks", AAZListType, ".resource_navigation_links") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - properties.set_prop("serviceAssociationLinks", AAZListType, ".service_association_links") - properties.set_prop("serviceEndpointPolicies", AAZListType, ".service_endpoint_policies") - properties.set_prop("serviceEndpoints", AAZListType, ".service_endpoints") - - address_prefixes = _builder.get(".properties.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - delegations = _builder.get(".properties.delegations") - if delegations is not None: - delegations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.delegations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.delegations[].properties") - if properties is not None: - properties.set_prop("actions", AAZListType, ".actions") - properties.set_prop("serviceName", AAZStrType, ".service_name") - - actions = _builder.get(".properties.delegations[].properties.actions") - if actions is not None: - actions.set_elements(AAZStrType, ".") - - resource_navigation_links = _builder.get(".properties.resourceNavigationLinks") - if resource_navigation_links is not None: - resource_navigation_links.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.resourceNavigationLinks[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.resourceNavigationLinks[].properties") - if properties is not None: - properties.set_prop("link", AAZStrType, ".link") - properties.set_prop("linkedResourceType", AAZStrType, ".linked_resource_type") - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("disableBgpRoutePropagation", AAZBoolType, ".disable_bgp_route_propagation") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - service_association_links = _builder.get(".properties.serviceAssociationLinks") - if service_association_links is not None: - service_association_links.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceAssociationLinks[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.serviceAssociationLinks[].properties") - if properties is not None: - properties.set_prop("link", AAZStrType, ".link") - properties.set_prop("linkedResourceType", AAZStrType, ".linked_resource_type") - - service_endpoint_policies = _builder.get(".properties.serviceEndpointPolicies") - if service_endpoint_policies is not None: - service_endpoint_policies.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpointPolicies[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.serviceEndpointPolicies[].properties") - if properties is not None: - properties.set_prop("serviceEndpointPolicyDefinitions", AAZListType, ".service_endpoint_policy_definitions") - - service_endpoint_policy_definitions = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions") - if service_endpoint_policy_definitions is not None: - service_endpoint_policy_definitions.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties") - if properties is not None: - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("service", AAZStrType, ".service") - properties.set_prop("serviceResources", AAZListType, ".service_resources") - - service_resources = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties.serviceResources") - if service_resources is not None: - service_resources.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.serviceEndpointPolicies[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - service_endpoints = _builder.get(".properties.serviceEndpoints") - if service_endpoints is not None: - service_endpoints.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpoints[]") - if _elements is not None: - _elements.set_prop("locations", AAZListType, ".locations") - _elements.set_prop("provisioningState", AAZStrType, ".provisioning_state") - _elements.set_prop("service", AAZStrType, ".service") - - locations = _builder.get(".properties.serviceEndpoints[].locations") - if locations is not None: - locations.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_virtual_network_tap_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("destinationLoadBalancerFrontEndIPConfiguration", AAZObjectType, ".destination_load_balancer_front_end_ip_configuration") - cls._build_schema_network_interface_ip_configuration_create(properties.set_prop("destinationNetworkInterfaceIPConfiguration", AAZObjectType, ".destination_network_interface_ip_configuration")) - properties.set_prop("destinationPort", AAZIntType, ".destination_port") - - destination_load_balancer_front_end_ip_configuration = _builder.get(".properties.destinationLoadBalancerFrontEndIPConfiguration") - if destination_load_balancer_front_end_ip_configuration is not None: - destination_load_balancer_front_end_ip_configuration.set_prop("etag", AAZStrType, ".etag") - destination_load_balancer_front_end_ip_configuration.set_prop("id", AAZStrType, ".id") - destination_load_balancer_front_end_ip_configuration.set_prop("name", AAZStrType, ".name") - destination_load_balancer_front_end_ip_configuration.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - destination_load_balancer_front_end_ip_configuration.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties.destinationLoadBalancerFrontEndIPConfiguration.properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_create(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_sub_resource_create(properties.set_prop("publicIPPrefix", AAZObjectType, ".public_ip_prefix")) - cls._build_schema_subnet_create(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - zones = _builder.get(".properties.destinationLoadBalancerFrontEndIPConfiguration.zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_delete.py deleted file mode 100644 index 2055fdb177b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic delete", -) -class Delete(AAZCommand): - """Delete a network interface. - - :example: Delete a network interface. - az network nic delete -g MyResourceGroup -n MyNic - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkInterfacesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class NetworkInterfacesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_list.py deleted file mode 100644 index 36f0910ca71..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_list.py +++ /dev/null @@ -1,1523 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic list", -) -class List(AAZCommand): - """List network interfaces. - - To list network interfaces attached to VMs in VM scale sets use `az vmss nic list` or `az vmss nic list-vm-nics`. - - :example: List all NICs by internal DNS suffix. - az network nic list --query "[?dnsSettings.internalDomainNameSuffix=`{dnsSuffix}`]" - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/networkinterfaces", "2018-11-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.NetworkInterfacesList(ctx=self.ctx)() - if condition_1: - self.NetworkInterfacesListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class NetworkInterfacesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_network_interface_read(value.Element) - - return cls._schema_on_200 - - class NetworkInterfacesListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_network_interface_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_list_effective_nsg.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_list_effective_nsg.py deleted file mode 100644 index e1d3e9b9e4a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_list_effective_nsg.py +++ /dev/null @@ -1,291 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic list-effective-nsg", -) -class ListEffectiveNsg(AAZCommand): - """List all effective network security groups applied to a network interface. - - To learn more about troubleshooting using effective security rules visit https://learn.microsoft.com/en-us/azure/virtual-network/diagnose-network-traffic-filter-problem. - - :example: List the effective security groups associated with a NIC. - az network nic list-effective-nsg -g MyResourceGroup -n MyNic - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}/effectivenetworksecuritygroups", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkInterfacesListEffectiveNetworkSecurityGroups(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkInterfacesListEffectiveNetworkSecurityGroups(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.association = AAZObjectType() - _element.effective_security_rules = AAZListType( - serialized_name="effectiveSecurityRules", - ) - _element.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - _ListEffectiveNsgHelper._build_schema_sub_resource_read(_element.network_security_group) - _element.tag_map = AAZDictType( - serialized_name="tagMap", - ) - - association = cls._schema_on_200.value.Element.association - association.network_interface = AAZObjectType( - serialized_name="networkInterface", - ) - _ListEffectiveNsgHelper._build_schema_sub_resource_read(association.network_interface) - association.subnet = AAZObjectType() - _ListEffectiveNsgHelper._build_schema_sub_resource_read(association.subnet) - - effective_security_rules = cls._schema_on_200.value.Element.effective_security_rules - effective_security_rules.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.effective_security_rules.Element - _element.access = AAZStrType() - _element.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - _element.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - _element.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - _element.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - _element.direction = AAZStrType() - _element.expanded_destination_address_prefix = AAZListType( - serialized_name="expandedDestinationAddressPrefix", - ) - _element.expanded_source_address_prefix = AAZListType( - serialized_name="expandedSourceAddressPrefix", - ) - _element.name = AAZStrType() - _element.priority = AAZIntType() - _element.protocol = AAZStrType() - _element.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - _element.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - _element.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - _element.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = cls._schema_on_200.value.Element.effective_security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_port_ranges = cls._schema_on_200.value.Element.effective_security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - expanded_destination_address_prefix = cls._schema_on_200.value.Element.effective_security_rules.Element.expanded_destination_address_prefix - expanded_destination_address_prefix.Element = AAZStrType() - - expanded_source_address_prefix = cls._schema_on_200.value.Element.effective_security_rules.Element.expanded_source_address_prefix - expanded_source_address_prefix.Element = AAZStrType() - - source_address_prefixes = cls._schema_on_200.value.Element.effective_security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_port_ranges = cls._schema_on_200.value.Element.effective_security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrType() - - tag_map = cls._schema_on_200.value.Element.tag_map - tag_map.Element = AAZListType() - - _element = cls._schema_on_200.value.Element.tag_map.Element - _element.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListEffectiveNsgHelper: - """Helper class for ListEffectiveNsg""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["ListEffectiveNsg"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_show.py deleted file mode 100644 index 75b16195d42..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_show.py +++ /dev/null @@ -1,1439 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic show", -) -class Show(AAZCommand): - """Get the details of a network interface. - - :example: Get the internal domain name suffix of a NIC. - az network nic show -g MyResourceGroup -n MyNic --query "dnsSettings.internalDomainNameSuffix" - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_show_effective_route_table.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_show_effective_route_table.py deleted file mode 100644 index 89201eb4fc5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_show_effective_route_table.py +++ /dev/null @@ -1,211 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic show-effective-route-table", -) -class ShowEffectiveRouteTable(AAZCommand): - """Show the effective route table applied to a network interface. - - To learn more about troubleshooting using the effective route tables visit https://learn.microsoft.com/en-us/azure/virtual-network/diagnose-network-routing-problem#using-effective-routes-to-troubleshoot-vm-traffic-flow. - - :example: Show the effective routes applied to a network interface. - az network nic show-effective-route-table -g MyResourceGroup -n MyNic - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}/effectiveroutetable", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkInterfacesGetEffectiveRouteTable(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkInterfacesGetEffectiveRouteTable(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.address_prefix = AAZListType( - serialized_name="addressPrefix", - ) - _element.name = AAZStrType() - _element.next_hop_ip_address = AAZListType( - serialized_name="nextHopIpAddress", - ) - _element.next_hop_type = AAZStrType( - serialized_name="nextHopType", - ) - _element.source = AAZStrType() - _element.state = AAZStrType() - - address_prefix = cls._schema_on_200.value.Element.address_prefix - address_prefix.Element = AAZStrType() - - next_hop_ip_address = cls._schema_on_200.value.Element.next_hop_ip_address - next_hop_ip_address.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowEffectiveRouteTableHelper: - """Helper class for ShowEffectiveRouteTable""" - - -__all__ = ["ShowEffectiveRouteTable"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_update.py deleted file mode 100644 index 93b6e967c24..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_update.py +++ /dev/null @@ -1,4050 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic update", -) -class Update(AAZCommand): - """Update a network interface. - - :example: Update a network interface to use a different network security group. - az network nic update -g MyResourceGroup -n MyNic --network-security-group MyNewNsg - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.accelerated_networking = AAZBoolArg( - options=["--accelerated-networking"], - help="Whether to enable accelerated networking.", - nullable=True, - ) - _args_schema.ip_forwarding = AAZBoolArg( - options=["--ip-forwarding"], - help="Whether to enable IP forwarding.", - nullable=True, - ) - - # define Arg Group "DNS" - - _args_schema = cls._args_schema - _args_schema.dns_servers = AAZListArg( - options=["--dns-servers"], - arg_group="DNS", - help="Space-separated list of DNS server IP addresses. Use null to revert to default Azure servers.", - nullable=True, - ) - _args_schema.internal_dns_name = AAZStrArg( - options=["--internal-dns-name"], - arg_group="DNS", - help="Name of internal DNS label.", - nullable=True, - ) - - dns_servers = cls._args_schema.dns_servers - dns_servers.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "DnsSettings" - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.nsg = AAZObjectArg( - options=["--nsg"], - arg_group="Properties", - help="The reference to the NetworkSecurityGroup resource.", - nullable=True, - ) - _args_schema.tap_configurations = AAZListArg( - options=["--tap-configurations"], - arg_group="Properties", - help="A list of TapConfigurations of the network interface.", - nullable=True, - ) - - nsg = cls._args_schema.nsg - nsg.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - nsg.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - nsg.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - nsg.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - security_rules = cls._args_schema.nsg.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.nsg.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - _element.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - _element.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _element.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.", - nullable=True, - ) - _element.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - _element.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _element.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_schema.nsg.security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_schema.nsg.security_rules.Element.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_schema.nsg.security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_schema.nsg.security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_schema.nsg.security_rules.Element.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_schema.nsg.security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - tags = cls._args_schema.nsg.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - tap_configurations = cls._args_schema.tap_configurations - tap_configurations.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.tap_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkInterfaces/{}/tapConfigurations/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.virtual_network_tap = AAZObjectArg( - options=["virtual-network-tap"], - help="The reference of the Virtual Network Tap resource.", - nullable=True, - ) - cls._build_args_virtual_network_tap_update(_element.virtual_network_tap) - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_network_interface_ip_configuration_update = None - - @classmethod - def _build_args_network_interface_ip_configuration_update(cls, _schema): - if cls._args_network_interface_ip_configuration_update is not None: - _schema.application_gateway_backend_address_pools = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools - _schema.application_security_groups = cls._args_network_interface_ip_configuration_update.application_security_groups - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_update.name - _schema.primary = cls._args_network_interface_ip_configuration_update.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_update.private_ip_address - _schema.private_ip_address_version = cls._args_network_interface_ip_configuration_update.private_ip_address_version - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_update.private_ip_allocation_method - _schema.public_ip_address = cls._args_network_interface_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_update.subnet - _schema.virtual_network_taps = cls._args_network_interface_ip_configuration_update.virtual_network_taps - return - - cls._args_network_interface_ip_configuration_update = AAZObjectArg( - nullable=True, - ) - - network_interface_ip_configuration_update = cls._args_network_interface_ip_configuration_update - network_interface_ip_configuration_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - network_interface_ip_configuration_update.application_gateway_backend_address_pools = AAZListArg( - options=["application-gateway-backend-address-pools"], - help="The reference of ApplicationGatewayBackendAddressPool resource.", - nullable=True, - ) - network_interface_ip_configuration_update.application_security_groups = AAZListArg( - options=["application-security-groups"], - help="Application security groups in which the IP configuration is included.", - nullable=True, - ) - network_interface_ip_configuration_update.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - nullable=True, - ) - network_interface_ip_configuration_update.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - nullable=True, - ) - network_interface_ip_configuration_update.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - nullable=True, - ) - network_interface_ip_configuration_update.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="Private IP address of the IP configuration.", - nullable=True, - ) - network_interface_ip_configuration_update.private_ip_address_version = AAZStrArg( - options=["private-ip-address-version"], - help="Available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.", - nullable=True, - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - network_interface_ip_configuration_update.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - network_interface_ip_configuration_update.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address bound to the IP configuration.", - nullable=True, - ) - cls._build_args_public_ip_address_update(network_interface_ip_configuration_update.public_ip_address) - network_interface_ip_configuration_update.subnet = AAZObjectArg( - options=["subnet"], - help="Subnet bound to the IP configuration.", - nullable=True, - ) - cls._build_args_subnet_update(network_interface_ip_configuration_update.subnet) - network_interface_ip_configuration_update.virtual_network_taps = AAZListArg( - options=["virtual-network-taps"], - help="The reference to Virtual Network Taps.", - nullable=True, - ) - - application_gateway_backend_address_pools = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the backend address pool that is unique within an Application Gateway.", - nullable=True, - ) - _element.backend_addresses = AAZListArg( - options=["backend-addresses"], - help="Backend addresses", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.type = AAZStrArg( - options=["type"], - help="Type of the resource.", - nullable=True, - ) - - backend_addresses = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools.Element.backend_addresses - backend_addresses.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools.Element.backend_addresses.Element - _element.fqdn = AAZStrArg( - options=["fqdn"], - help="Fully qualified domain name (FQDN).", - nullable=True, - ) - _element.ip_address = AAZStrArg( - options=["ip-address"], - help="IP address", - nullable=True, - ) - - application_security_groups = cls._args_network_interface_ip_configuration_update.application_security_groups - application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(application_security_groups.Element) - - load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - nullable=True, - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - _element.enable_tcp_reset = AAZBoolArg( - options=["enable-tcp-reset"], - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - nullable=True, - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'.", - nullable=True, - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - virtual_network_taps = cls._args_network_interface_ip_configuration_update.virtual_network_taps - virtual_network_taps.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.virtual_network_taps.Element - _element.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkTaps/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.destination_load_balancer_front_end_ip_configuration = AAZObjectArg( - options=["destination-load-balancer-front-end-ip-configuration"], - help="The reference to the private IP address on the internal Load Balancer that will receive the tap", - nullable=True, - ) - _element.destination_network_interface_ip_configuration = AAZObjectArg( - options=["destination-network-interface-ip-configuration"], - help="The reference to the private IP Address of the collector nic that will receive the tap", - nullable=True, - ) - cls._build_args_network_interface_ip_configuration_update(_element.destination_network_interface_ip_configuration) - _element.destination_port = AAZIntArg( - options=["destination-port"], - help="The VXLAN destination port that will receive the tapped traffic.", - nullable=True, - ) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - destination_load_balancer_front_end_ip_configuration = cls._args_network_interface_ip_configuration_update.virtual_network_taps.Element.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - destination_load_balancer_front_end_ip_configuration.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/frontendIPConfigurations/{}", - ), - ) - destination_load_balancer_front_end_ip_configuration.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - destination_load_balancer_front_end_ip_configuration.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="The private IP address of the IP configuration.", - nullable=True, - ) - destination_load_balancer_front_end_ip_configuration.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The Private IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - destination_load_balancer_front_end_ip_configuration.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - destination_load_balancer_front_end_ip_configuration.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference of the Public IP resource.", - nullable=True, - ) - cls._build_args_public_ip_address_update(destination_load_balancer_front_end_ip_configuration.public_ip_address) - destination_load_balancer_front_end_ip_configuration.public_ip_prefix = AAZObjectArg( - options=["public-ip-prefix"], - help="The reference of the Public IP Prefix resource.", - nullable=True, - ) - cls._build_args_sub_resource_update(destination_load_balancer_front_end_ip_configuration.public_ip_prefix) - destination_load_balancer_front_end_ip_configuration.subnet = AAZObjectArg( - options=["subnet"], - help="The reference of the subnet resource.", - nullable=True, - ) - cls._build_args_subnet_update(destination_load_balancer_front_end_ip_configuration.subnet) - destination_load_balancer_front_end_ip_configuration.zones = AAZListArg( - options=["zones"], - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - nullable=True, - ) - - zones = cls._args_network_interface_ip_configuration_update.virtual_network_taps.Element.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrArg( - nullable=True, - ) - - tags = cls._args_network_interface_ip_configuration_update.virtual_network_taps.Element.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.application_gateway_backend_address_pools = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools - _schema.application_security_groups = cls._args_network_interface_ip_configuration_update.application_security_groups - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_update.name - _schema.primary = cls._args_network_interface_ip_configuration_update.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_update.private_ip_address - _schema.private_ip_address_version = cls._args_network_interface_ip_configuration_update.private_ip_address_version - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_update.private_ip_allocation_method - _schema.public_ip_address = cls._args_network_interface_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_update.subnet - _schema.virtual_network_taps = cls._args_network_interface_ip_configuration_update.virtual_network_taps - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg( - nullable=True, - ) - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - network_security_group_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - _element.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - _element.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - _element.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - _element.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - _element.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - _element.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_network_security_group_update.security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_network_security_group_update.security_rules.Element.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_network_security_group_update.security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_network_security_group_update.security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_network_security_group_update.security_rules.Element.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_network_security_group_update.security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.tags = cls._args_network_security_group_update.tags - - _args_public_ip_address_update = None - - @classmethod - def _build_args_public_ip_address_update(cls, _schema): - if cls._args_public_ip_address_update is not None: - _schema.ddos_settings = cls._args_public_ip_address_update.ddos_settings - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.id = cls._args_public_ip_address_update.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.ip_tags = cls._args_public_ip_address_update.ip_tags - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_address_version = cls._args_public_ip_address_update.public_ip_address_version - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.public_ip_prefix = cls._args_public_ip_address_update.public_ip_prefix - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.sku = cls._args_public_ip_address_update.sku - _schema.tags = cls._args_public_ip_address_update.tags - _schema.zones = cls._args_public_ip_address_update.zones - return - - cls._args_public_ip_address_update = AAZObjectArg( - nullable=True, - ) - - public_ip_address_update = cls._args_public_ip_address_update - public_ip_address_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - public_ip_address_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_update.ddos_settings = AAZObjectArg( - options=["ddos-settings"], - help="The DDoS protection custom policy associated with the public IP address.", - nullable=True, - ) - public_ip_address_update.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - nullable=True, - ) - public_ip_address_update.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - nullable=True, - ) - public_ip_address_update.ip_address = AAZStrArg( - options=["ip-address"], - help="The IP address associated with the public IP address resource.", - nullable=True, - ) - public_ip_address_update.ip_tags = AAZListArg( - options=["ip-tags"], - help="The list of tags associated with the public IP address.", - nullable=True, - ) - public_ip_address_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - public_ip_address_update.public_ip_address_version = AAZStrArg( - options=["public-ip-address-version"], - help="The public IP address version. Possible values are: 'IPv4' and 'IPv6'.", - nullable=True, - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - public_ip_address_update.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_update.public_ip_prefix = AAZObjectArg( - options=["public-ip-prefix"], - help="The Public IP Prefix this Public IP Address should be allocated from.", - nullable=True, - ) - cls._build_args_sub_resource_update(public_ip_address_update.public_ip_prefix) - public_ip_address_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - nullable=True, - ) - public_ip_address_update.sku = AAZObjectArg( - options=["sku"], - help="The public IP address SKU.", - nullable=True, - ) - public_ip_address_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - public_ip_address_update.zones = AAZListArg( - options=["zones"], - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - nullable=True, - ) - - ddos_settings = cls._args_public_ip_address_update.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectArg( - options=["ddos-custom-policy"], - help="The DDoS custom policy associated with the public IP.", - nullable=True, - ) - cls._build_args_sub_resource_update(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrArg( - options=["protection-coverage"], - help="The DDoS protection policy customizability of the public IP. Only standard coverage will have the ability to be customized.", - nullable=True, - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - - dns_settings = cls._args_public_ip_address_update.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - nullable=True, - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - nullable=True, - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - nullable=True, - ) - - ip_tags = cls._args_public_ip_address_update.ip_tags - ip_tags.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_public_ip_address_update.ip_tags.Element - _element.ip_tag_type = AAZStrArg( - options=["ip-tag-type"], - help="Gets or sets the ipTag type: Example FirstPartyUsage.", - nullable=True, - ) - _element.tag = AAZStrArg( - options=["tag"], - help="Gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc", - nullable=True, - ) - - sku = cls._args_public_ip_address_update.sku - sku.name = AAZStrArg( - options=["name"], - help="Name of a public IP address SKU.", - nullable=True, - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - - tags = cls._args_public_ip_address_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - zones = cls._args_public_ip_address_update.zones - zones.Element = AAZStrArg( - nullable=True, - ) - - _schema.ddos_settings = cls._args_public_ip_address_update.ddos_settings - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.id = cls._args_public_ip_address_update.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.ip_tags = cls._args_public_ip_address_update.ip_tags - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_address_version = cls._args_public_ip_address_update.public_ip_address_version - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.public_ip_prefix = cls._args_public_ip_address_update.public_ip_prefix - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.sku = cls._args_public_ip_address_update.sku - _schema.tags = cls._args_public_ip_address_update.tags - _schema.zones = cls._args_public_ip_address_update.zones - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_subnet_update = None - - @classmethod - def _build_args_subnet_update(cls, _schema): - if cls._args_subnet_update is not None: - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.address_prefixes = cls._args_subnet_update.address_prefixes - _schema.delegations = cls._args_subnet_update.delegations - _schema.id = cls._args_subnet_update.id - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.resource_navigation_links = cls._args_subnet_update.resource_navigation_links - _schema.route_table = cls._args_subnet_update.route_table - _schema.service_association_links = cls._args_subnet_update.service_association_links - _schema.service_endpoint_policies = cls._args_subnet_update.service_endpoint_policies - _schema.service_endpoints = cls._args_subnet_update.service_endpoints - return - - cls._args_subnet_update = AAZObjectArg( - nullable=True, - ) - - subnet_update = cls._args_subnet_update - subnet_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}", - ), - ) - subnet_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - subnet_update.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - nullable=True, - ) - subnet_update.address_prefixes = AAZListArg( - options=["address-prefixes"], - help="List of address prefixes for the subnet.", - nullable=True, - ) - subnet_update.delegations = AAZListArg( - options=["delegations"], - help="Gets an array of references to the delegations on the subnet.", - nullable=True, - ) - subnet_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(subnet_update.network_security_group) - subnet_update.resource_navigation_links = AAZListArg( - options=["resource-navigation-links"], - help="Gets an array of references to the external resources using subnet.", - nullable=True, - ) - subnet_update.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - nullable=True, - ) - subnet_update.service_association_links = AAZListArg( - options=["service-association-links"], - help="Gets an array of references to services injecting into this subnet.", - nullable=True, - ) - subnet_update.service_endpoint_policies = AAZListArg( - options=["service-endpoint-policies"], - help="An array of service endpoint policies.", - nullable=True, - ) - subnet_update.service_endpoints = AAZListArg( - options=["service-endpoints"], - help="An array of service endpoints.", - nullable=True, - ) - - address_prefixes = cls._args_subnet_update.address_prefixes - address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - delegations = cls._args_subnet_update.delegations - delegations.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.delegations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a subnet. This name can be used to access the resource.", - nullable=True, - ) - _element.actions = AAZListArg( - options=["actions"], - help="Describes the actions permitted to the service upon delegation", - nullable=True, - ) - _element.service_name = AAZStrArg( - options=["service-name"], - help="The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers)", - nullable=True, - ) - - actions = cls._args_subnet_update.delegations.Element.actions - actions.Element = AAZStrArg( - nullable=True, - ) - - resource_navigation_links = cls._args_subnet_update.resource_navigation_links - resource_navigation_links.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.resource_navigation_links.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.link = AAZStrArg( - options=["link"], - help="Link to the external resource", - nullable=True, - ) - _element.linked_resource_type = AAZStrArg( - options=["linked-resource-type"], - help="Resource type of the linked resource.", - nullable=True, - ) - - route_table = cls._args_subnet_update.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.disable_bgp_route_propagation = AAZBoolArg( - options=["disable-bgp-route-propagation"], - help="Gets or sets whether to disable the routes learned by BGP on that route table. True means disable.", - nullable=True, - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - nullable=True, - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - routes = cls._args_subnet_update.route_table.routes - routes.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - nullable=True, - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - nullable=True, - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - tags = cls._args_subnet_update.route_table.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - service_association_links = cls._args_subnet_update.service_association_links - service_association_links.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.service_association_links.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.link = AAZStrArg( - options=["link"], - help="Link to the external resource.", - nullable=True, - ) - _element.linked_resource_type = AAZStrArg( - options=["linked-resource-type"], - help="Resource type of the linked resource.", - nullable=True, - ) - - service_endpoint_policies = cls._args_subnet_update.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.service_endpoint_policies.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.service_endpoint_policy_definitions = AAZListArg( - options=["service-endpoint-policy-definitions"], - help="A collection of service endpoint policy definitions of the service endpoint policy.", - nullable=True, - ) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - service_endpoint_policy_definitions = cls._args_subnet_update.service_endpoint_policies.Element.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.service_endpoint_policies.Element.service_endpoint_policy_definitions.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}/serviceEndpointPolicyDefinitions/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.service = AAZStrArg( - options=["service"], - help="service endpoint name.", - nullable=True, - ) - _element.service_resources = AAZListArg( - options=["service-resources"], - help="A list of service resources.", - nullable=True, - ) - - service_resources = cls._args_subnet_update.service_endpoint_policies.Element.service_endpoint_policy_definitions.Element.service_resources - service_resources.Element = AAZStrArg( - nullable=True, - ) - - tags = cls._args_subnet_update.service_endpoint_policies.Element.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - service_endpoints = cls._args_subnet_update.service_endpoints - service_endpoints.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.service_endpoints.Element - _element.locations = AAZListArg( - options=["locations"], - help="A list of locations.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - nullable=True, - ) - _element.service = AAZStrArg( - options=["service"], - help="The type of the endpoint service.", - nullable=True, - ) - - locations = cls._args_subnet_update.service_endpoints.Element.locations - locations.Element = AAZStrArg( - nullable=True, - ) - - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.address_prefixes = cls._args_subnet_update.address_prefixes - _schema.delegations = cls._args_subnet_update.delegations - _schema.id = cls._args_subnet_update.id - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.resource_navigation_links = cls._args_subnet_update.resource_navigation_links - _schema.route_table = cls._args_subnet_update.route_table - _schema.service_association_links = cls._args_subnet_update.service_association_links - _schema.service_endpoint_policies = cls._args_subnet_update.service_endpoint_policies - _schema.service_endpoints = cls._args_subnet_update.service_endpoints - - _args_virtual_network_tap_update = None - - @classmethod - def _build_args_virtual_network_tap_update(cls, _schema): - if cls._args_virtual_network_tap_update is not None: - _schema.destination_load_balancer_front_end_ip_configuration = cls._args_virtual_network_tap_update.destination_load_balancer_front_end_ip_configuration - _schema.destination_network_interface_ip_configuration = cls._args_virtual_network_tap_update.destination_network_interface_ip_configuration - _schema.destination_port = cls._args_virtual_network_tap_update.destination_port - _schema.etag = cls._args_virtual_network_tap_update.etag - _schema.id = cls._args_virtual_network_tap_update.id - _schema.location = cls._args_virtual_network_tap_update.location - _schema.tags = cls._args_virtual_network_tap_update.tags - return - - cls._args_virtual_network_tap_update = AAZObjectArg( - nullable=True, - ) - - virtual_network_tap_update = cls._args_virtual_network_tap_update - virtual_network_tap_update.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - virtual_network_tap_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkTaps/{}", - ), - ) - virtual_network_tap_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - virtual_network_tap_update.destination_load_balancer_front_end_ip_configuration = AAZObjectArg( - options=["destination-load-balancer-front-end-ip-configuration"], - help="The reference to the private IP address on the internal Load Balancer that will receive the tap", - nullable=True, - ) - virtual_network_tap_update.destination_network_interface_ip_configuration = AAZObjectArg( - options=["destination-network-interface-ip-configuration"], - help="The reference to the private IP Address of the collector nic that will receive the tap", - nullable=True, - ) - cls._build_args_network_interface_ip_configuration_update(virtual_network_tap_update.destination_network_interface_ip_configuration) - virtual_network_tap_update.destination_port = AAZIntArg( - options=["destination-port"], - help="The VXLAN destination port that will receive the tapped traffic.", - nullable=True, - ) - virtual_network_tap_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - destination_load_balancer_front_end_ip_configuration = cls._args_virtual_network_tap_update.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - destination_load_balancer_front_end_ip_configuration.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/frontendIPConfigurations/{}", - ), - ) - destination_load_balancer_front_end_ip_configuration.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - destination_load_balancer_front_end_ip_configuration.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="The private IP address of the IP configuration.", - nullable=True, - ) - destination_load_balancer_front_end_ip_configuration.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The Private IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - destination_load_balancer_front_end_ip_configuration.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - destination_load_balancer_front_end_ip_configuration.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference of the Public IP resource.", - nullable=True, - ) - cls._build_args_public_ip_address_update(destination_load_balancer_front_end_ip_configuration.public_ip_address) - destination_load_balancer_front_end_ip_configuration.public_ip_prefix = AAZObjectArg( - options=["public-ip-prefix"], - help="The reference of the Public IP Prefix resource.", - nullable=True, - ) - cls._build_args_sub_resource_update(destination_load_balancer_front_end_ip_configuration.public_ip_prefix) - destination_load_balancer_front_end_ip_configuration.subnet = AAZObjectArg( - options=["subnet"], - help="The reference of the subnet resource.", - nullable=True, - ) - cls._build_args_subnet_update(destination_load_balancer_front_end_ip_configuration.subnet) - destination_load_balancer_front_end_ip_configuration.zones = AAZListArg( - options=["zones"], - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - nullable=True, - ) - - zones = cls._args_virtual_network_tap_update.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrArg( - nullable=True, - ) - - tags = cls._args_virtual_network_tap_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.destination_load_balancer_front_end_ip_configuration = cls._args_virtual_network_tap_update.destination_load_balancer_front_end_ip_configuration - _schema.destination_network_interface_ip_configuration = cls._args_virtual_network_tap_update.destination_network_interface_ip_configuration - _schema.destination_port = cls._args_virtual_network_tap_update.destination_port - _schema.etag = cls._args_virtual_network_tap_update.etag - _schema.id = cls._args_virtual_network_tap_update.id - _schema.location = cls._args_virtual_network_tap_update.location - _schema.tags = cls._args_virtual_network_tap_update.tags - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("dnsSettings", AAZObjectType) - properties.set_prop("enableAcceleratedNetworking", AAZBoolType, ".accelerated_networking") - properties.set_prop("enableIPForwarding", AAZBoolType, ".ip_forwarding") - properties.set_prop("networkSecurityGroup", AAZObjectType, ".nsg") - properties.set_prop("tapConfigurations", AAZListType, ".tap_configurations") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("dnsServers", AAZListType, ".dns_servers") - dns_settings.set_prop("internalDnsNameLabel", AAZStrType, ".internal_dns_name") - - dns_servers = _builder.get(".properties.dnsSettings.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - network_security_group = _builder.get(".properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("id", AAZStrType, ".id") - network_security_group.set_prop("location", AAZStrType, ".location") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - network_security_group.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.networkSecurityGroup.properties") - if properties is not None: - properties.set_prop("securityRules", AAZListType, ".security_rules") - - security_rules = _builder.get(".properties.networkSecurityGroup.properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.networkSecurityGroup.properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - _UpdateHelper._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - _UpdateHelper._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.networkSecurityGroup.properties.securityRules[].properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.networkSecurityGroup.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - tap_configurations = _builder.get(".properties.tapConfigurations") - if tap_configurations is not None: - tap_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.tapConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.tapConfigurations[].properties") - if properties is not None: - _UpdateHelper._build_schema_virtual_network_tap_update(properties.set_prop("virtualNetworkTap", AAZObjectType, ".virtual_network_tap")) - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_interface_ip_configuration_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("applicationGatewayBackendAddressPools", AAZListType, ".application_gateway_backend_address_pools") - properties.set_prop("applicationSecurityGroups", AAZListType, ".application_security_groups") - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAddressVersion", AAZStrType, ".private_ip_address_version") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - properties.set_prop("virtualNetworkTaps", AAZListType, ".virtual_network_taps") - - application_gateway_backend_address_pools = _builder.get(".properties.applicationGatewayBackendAddressPools") - if application_gateway_backend_address_pools is not None: - application_gateway_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationGatewayBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("type", AAZStrType, ".type") - - properties = _builder.get(".properties.applicationGatewayBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("backendAddresses", AAZListType, ".backend_addresses") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - backend_addresses = _builder.get(".properties.applicationGatewayBackendAddressPools[].properties.backendAddresses") - if backend_addresses is not None: - backend_addresses.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationGatewayBackendAddressPools[].properties.backendAddresses[]") - if _elements is not None: - _elements.set_prop("fqdn", AAZStrType, ".fqdn") - _elements.set_prop("ipAddress", AAZStrType, ".ip_address") - - application_security_groups = _builder.get(".properties.applicationSecurityGroups") - if application_security_groups is not None: - cls._build_schema_application_security_group_update(application_security_groups.set_elements(AAZObjectType, ".")) - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - cls._build_schema_sub_resource_update(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - virtual_network_taps = _builder.get(".properties.virtualNetworkTaps") - if virtual_network_taps is not None: - virtual_network_taps.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.virtualNetworkTaps[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.virtualNetworkTaps[].properties") - if properties is not None: - properties.set_prop("destinationLoadBalancerFrontEndIPConfiguration", AAZObjectType, ".destination_load_balancer_front_end_ip_configuration") - cls._build_schema_network_interface_ip_configuration_update(properties.set_prop("destinationNetworkInterfaceIPConfiguration", AAZObjectType, ".destination_network_interface_ip_configuration")) - properties.set_prop("destinationPort", AAZIntType, ".destination_port") - - destination_load_balancer_front_end_ip_configuration = _builder.get(".properties.virtualNetworkTaps[].properties.destinationLoadBalancerFrontEndIPConfiguration") - if destination_load_balancer_front_end_ip_configuration is not None: - destination_load_balancer_front_end_ip_configuration.set_prop("etag", AAZStrType, ".etag") - destination_load_balancer_front_end_ip_configuration.set_prop("id", AAZStrType, ".id") - destination_load_balancer_front_end_ip_configuration.set_prop("name", AAZStrType, ".name") - destination_load_balancer_front_end_ip_configuration.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - destination_load_balancer_front_end_ip_configuration.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties.virtualNetworkTaps[].properties.destinationLoadBalancerFrontEndIPConfiguration.properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_sub_resource_update(properties.set_prop("publicIPPrefix", AAZObjectType, ".public_ip_prefix")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - zones = _builder.get(".properties.virtualNetworkTaps[].properties.destinationLoadBalancerFrontEndIPConfiguration.zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.virtualNetworkTaps[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.securityRules[].properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.securityRules[].properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.securityRules[].properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.securityRules[].properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.securityRules[].properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.securityRules[].properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("sku", AAZObjectType, ".sku") - _builder.set_prop("tags", AAZDictType, ".tags") - _builder.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("ddosSettings", AAZObjectType, ".ddos_settings") - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("ipTags", AAZListType, ".ip_tags") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAddressVersion", AAZStrType, ".public_ip_address_version") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - cls._build_schema_sub_resource_update(properties.set_prop("publicIPPrefix", AAZObjectType, ".public_ip_prefix")) - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - ddos_settings = _builder.get(".properties.ddosSettings") - if ddos_settings is not None: - cls._build_schema_sub_resource_update(ddos_settings.set_prop("ddosCustomPolicy", AAZObjectType, ".ddos_custom_policy")) - ddos_settings.set_prop("protectionCoverage", AAZStrType, ".protection_coverage") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - ip_tags = _builder.get(".properties.ipTags") - if ip_tags is not None: - ip_tags.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipTags[]") - if _elements is not None: - _elements.set_prop("ipTagType", AAZStrType, ".ip_tag_type") - _elements.set_prop("tag", AAZStrType, ".tag") - - sku = _builder.get(".sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".name") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - zones = _builder.get(".zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - properties.set_prop("delegations", AAZListType, ".delegations") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("resourceNavigationLinks", AAZListType, ".resource_navigation_links") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - properties.set_prop("serviceAssociationLinks", AAZListType, ".service_association_links") - properties.set_prop("serviceEndpointPolicies", AAZListType, ".service_endpoint_policies") - properties.set_prop("serviceEndpoints", AAZListType, ".service_endpoints") - - address_prefixes = _builder.get(".properties.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - delegations = _builder.get(".properties.delegations") - if delegations is not None: - delegations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.delegations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.delegations[].properties") - if properties is not None: - properties.set_prop("actions", AAZListType, ".actions") - properties.set_prop("serviceName", AAZStrType, ".service_name") - - actions = _builder.get(".properties.delegations[].properties.actions") - if actions is not None: - actions.set_elements(AAZStrType, ".") - - resource_navigation_links = _builder.get(".properties.resourceNavigationLinks") - if resource_navigation_links is not None: - resource_navigation_links.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.resourceNavigationLinks[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.resourceNavigationLinks[].properties") - if properties is not None: - properties.set_prop("link", AAZStrType, ".link") - properties.set_prop("linkedResourceType", AAZStrType, ".linked_resource_type") - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("disableBgpRoutePropagation", AAZBoolType, ".disable_bgp_route_propagation") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - service_association_links = _builder.get(".properties.serviceAssociationLinks") - if service_association_links is not None: - service_association_links.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceAssociationLinks[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.serviceAssociationLinks[].properties") - if properties is not None: - properties.set_prop("link", AAZStrType, ".link") - properties.set_prop("linkedResourceType", AAZStrType, ".linked_resource_type") - - service_endpoint_policies = _builder.get(".properties.serviceEndpointPolicies") - if service_endpoint_policies is not None: - service_endpoint_policies.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpointPolicies[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.serviceEndpointPolicies[].properties") - if properties is not None: - properties.set_prop("serviceEndpointPolicyDefinitions", AAZListType, ".service_endpoint_policy_definitions") - - service_endpoint_policy_definitions = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions") - if service_endpoint_policy_definitions is not None: - service_endpoint_policy_definitions.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties") - if properties is not None: - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("service", AAZStrType, ".service") - properties.set_prop("serviceResources", AAZListType, ".service_resources") - - service_resources = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties.serviceResources") - if service_resources is not None: - service_resources.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.serviceEndpointPolicies[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - service_endpoints = _builder.get(".properties.serviceEndpoints") - if service_endpoints is not None: - service_endpoints.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpoints[]") - if _elements is not None: - _elements.set_prop("locations", AAZListType, ".locations") - _elements.set_prop("provisioningState", AAZStrType, ".provisioning_state") - _elements.set_prop("service", AAZStrType, ".service") - - locations = _builder.get(".properties.serviceEndpoints[].locations") - if locations is not None: - locations.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_virtual_network_tap_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("destinationLoadBalancerFrontEndIPConfiguration", AAZObjectType, ".destination_load_balancer_front_end_ip_configuration") - cls._build_schema_network_interface_ip_configuration_update(properties.set_prop("destinationNetworkInterfaceIPConfiguration", AAZObjectType, ".destination_network_interface_ip_configuration")) - properties.set_prop("destinationPort", AAZIntType, ".destination_port") - - destination_load_balancer_front_end_ip_configuration = _builder.get(".properties.destinationLoadBalancerFrontEndIPConfiguration") - if destination_load_balancer_front_end_ip_configuration is not None: - destination_load_balancer_front_end_ip_configuration.set_prop("etag", AAZStrType, ".etag") - destination_load_balancer_front_end_ip_configuration.set_prop("id", AAZStrType, ".id") - destination_load_balancer_front_end_ip_configuration.set_prop("name", AAZStrType, ".name") - destination_load_balancer_front_end_ip_configuration.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - destination_load_balancer_front_end_ip_configuration.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties.destinationLoadBalancerFrontEndIPConfiguration.properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_sub_resource_update(properties.set_prop("publicIPPrefix", AAZObjectType, ".public_ip_prefix")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - zones = _builder.get(".properties.destinationLoadBalancerFrontEndIPConfiguration.zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_wait.py deleted file mode 100644 index 3ed7db67a61..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/_wait.py +++ /dev/null @@ -1,1435 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/__cmd_group.py deleted file mode 100644 index cede61b5c80..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 nic ip-config", -) -class __CMDGroup(AAZCommandGroup): - """Manage IP configurations of a network interface. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_create.py deleted file mode 100644 index 19bbdf6f29a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_create.py +++ /dev/null @@ -1,3493 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config create", -) -class Create(AAZCommand): - """Create an IP configuration. - - You must have the Microsoft.Network/AllowMultipleIpConfigurationsPerNic feature enabled for your subscription. Only one configuration may be designated as the primary IP configuration per NIC, using the `--make-primary` flag. - - :example: Create a primary IP configuration for a NIC. - az network nic ip-config create -g MyResourceGroup -n MyIpConfig --nic-name MyNic --make-primary - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01", "properties.ipConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the IP configuration.", - required=True, - ) - - # define Arg Group "IP Configuration" - - _args_schema = cls._args_schema - _args_schema.make_primary = AAZBoolArg( - options=["--make-primary"], - arg_group="IP Configuration", - help="Set to make this configuration the primary one for the NIC.", - default=False, - ) - _args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="IP Configuration", - help="Static IP address to use or \"\"('\"\"' in PowerShell) to use a dynamic address.", - ) - _args_schema.private_ip_address_version = AAZStrArg( - options=["--private-ip-address-version"], - arg_group="IP Configuration", - help="Version of private IP address to use.", - default="IPv4", - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - _args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="IP Configuration", - help="Name or ID of an existing public IP address.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - _args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="IP Configuration", - help="Name or ID of an existing subnet. If name specified, please also specify `--vnet-name`.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}", - ), - ) - - # define Arg Group "Parameters.properties.ipConfigurations[]" - - # define Arg Group "PipObj" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.application_gateway_backend_address_pools = AAZListArg( - options=["--application-gateway-backend-address-pools"], - arg_group="Properties", - help="The reference to ApplicationGatewayBackendAddressPool resource.", - ) - _args_schema.asgs_obj = AAZListArg( - options=["--asgs-obj"], - arg_group="Properties", - help="Application security groups in which the IP configuration is included.", - ) - _args_schema.load_balancer_backend_address_pools = AAZListArg( - options=["--load-balancer-backend-address-pools"], - arg_group="Properties", - help="The reference to LoadBalancerBackendAddressPool resource.", - ) - _args_schema.load_balancer_inbound_nat_rules = AAZListArg( - options=["--load-balancer-inbound-nat-rules"], - arg_group="Properties", - help="A list of references of LoadBalancerInboundNatRules.", - ) - _args_schema.private_ip_allocation_method = AAZStrArg( - options=["--private-ip-allocation-method"], - arg_group="Properties", - help="The private IP address allocation method.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - - application_gateway_backend_address_pools = cls._args_schema.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_schema.application_gateway_backend_address_pools.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the backend address pool that is unique within an Application Gateway.", - ) - - asgs_obj = cls._args_schema.asgs_obj - asgs_obj.Element = AAZObjectArg() - - _element = cls._args_schema.asgs_obj.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_schema.asgs_obj.Element.tags - tags.Element = AAZStrArg() - - load_balancer_backend_address_pools = cls._args_schema.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_schema.load_balancer_backend_address_pools.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resource.", - ) - - load_balancer_inbound_nat_rules = cls._args_schema.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_schema.load_balancer_inbound_nat_rules.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource.", - ) - - # define Arg Group "PublicIPAddress" - - # define Arg Group "Subnet" - - # define Arg Group "SubnetObj" - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg() - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_network_interface_ip_configuration_update = None - - @classmethod - def _build_args_network_interface_ip_configuration_update(cls, _schema): - if cls._args_network_interface_ip_configuration_update is not None: - _schema.application_gateway_backend_address_pools = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools - _schema.application_security_groups = cls._args_network_interface_ip_configuration_update.application_security_groups - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_update.name - _schema.primary = cls._args_network_interface_ip_configuration_update.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_update.private_ip_address - _schema.private_ip_address_version = cls._args_network_interface_ip_configuration_update.private_ip_address_version - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_update.private_ip_allocation_method - _schema.public_ip_address = cls._args_network_interface_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_update.subnet - _schema.virtual_network_taps = cls._args_network_interface_ip_configuration_update.virtual_network_taps - return - - cls._args_network_interface_ip_configuration_update = AAZObjectArg() - - network_interface_ip_configuration_update = cls._args_network_interface_ip_configuration_update - network_interface_ip_configuration_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - network_interface_ip_configuration_update.application_gateway_backend_address_pools = AAZListArg( - options=["application-gateway-backend-address-pools"], - help="The reference of ApplicationGatewayBackendAddressPool resource.", - ) - network_interface_ip_configuration_update.application_security_groups = AAZListArg( - options=["application-security-groups"], - help="Application security groups in which the IP configuration is included.", - ) - network_interface_ip_configuration_update.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - ) - network_interface_ip_configuration_update.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - ) - network_interface_ip_configuration_update.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - ) - network_interface_ip_configuration_update.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="Private IP address of the IP configuration.", - ) - network_interface_ip_configuration_update.private_ip_address_version = AAZStrArg( - options=["private-ip-address-version"], - help="Available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.", - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - network_interface_ip_configuration_update.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - network_interface_ip_configuration_update.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address bound to the IP configuration.", - ) - cls._build_args_public_ip_address_update(network_interface_ip_configuration_update.public_ip_address) - network_interface_ip_configuration_update.subnet = AAZObjectArg( - options=["subnet"], - help="Subnet bound to the IP configuration.", - ) - cls._build_args_subnet_update(network_interface_ip_configuration_update.subnet) - network_interface_ip_configuration_update.virtual_network_taps = AAZListArg( - options=["virtual-network-taps"], - help="The reference to Virtual Network Taps.", - ) - - application_gateway_backend_address_pools = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the backend address pool that is unique within an Application Gateway.", - ) - _element.backend_addresses = AAZListArg( - options=["backend-addresses"], - help="Backend addresses", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.type = AAZStrArg( - options=["type"], - help="Type of the resource.", - ) - - backend_addresses = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools.Element.backend_addresses - backend_addresses.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools.Element.backend_addresses.Element - _element.fqdn = AAZStrArg( - options=["fqdn"], - help="Fully qualified domain name (FQDN).", - ) - _element.ip_address = AAZStrArg( - options=["ip-address"], - help="IP address", - ) - - application_security_groups = cls._args_network_interface_ip_configuration_update.application_security_groups - application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_update(application_security_groups.Element) - - load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - ) - _element.enable_tcp_reset = AAZBoolArg( - options=["enable-tcp-reset"], - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - ) - cls._build_args_sub_resource_update(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'.", - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - virtual_network_taps = cls._args_network_interface_ip_configuration_update.virtual_network_taps - virtual_network_taps.Element = AAZObjectArg() - - _element = cls._args_network_interface_ip_configuration_update.virtual_network_taps.Element - _element.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkTaps/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.destination_load_balancer_front_end_ip_configuration = AAZObjectArg( - options=["destination-load-balancer-front-end-ip-configuration"], - help="The reference to the private IP address on the internal Load Balancer that will receive the tap", - ) - _element.destination_network_interface_ip_configuration = AAZObjectArg( - options=["destination-network-interface-ip-configuration"], - help="The reference to the private IP Address of the collector nic that will receive the tap", - ) - cls._build_args_network_interface_ip_configuration_update(_element.destination_network_interface_ip_configuration) - _element.destination_port = AAZIntArg( - options=["destination-port"], - help="The VXLAN destination port that will receive the tapped traffic.", - ) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - destination_load_balancer_front_end_ip_configuration = cls._args_network_interface_ip_configuration_update.virtual_network_taps.Element.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - destination_load_balancer_front_end_ip_configuration.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/frontendIPConfigurations/{}", - ), - ) - destination_load_balancer_front_end_ip_configuration.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - destination_load_balancer_front_end_ip_configuration.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="The private IP address of the IP configuration.", - ) - destination_load_balancer_front_end_ip_configuration.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The Private IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - destination_load_balancer_front_end_ip_configuration.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - destination_load_balancer_front_end_ip_configuration.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference of the Public IP resource.", - ) - cls._build_args_public_ip_address_update(destination_load_balancer_front_end_ip_configuration.public_ip_address) - destination_load_balancer_front_end_ip_configuration.public_ip_prefix = AAZObjectArg( - options=["public-ip-prefix"], - help="The reference of the Public IP Prefix resource.", - ) - cls._build_args_sub_resource_update(destination_load_balancer_front_end_ip_configuration.public_ip_prefix) - destination_load_balancer_front_end_ip_configuration.subnet = AAZObjectArg( - options=["subnet"], - help="The reference of the subnet resource.", - ) - cls._build_args_subnet_update(destination_load_balancer_front_end_ip_configuration.subnet) - destination_load_balancer_front_end_ip_configuration.zones = AAZListArg( - options=["zones"], - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - ) - - zones = cls._args_network_interface_ip_configuration_update.virtual_network_taps.Element.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrArg() - - tags = cls._args_network_interface_ip_configuration_update.virtual_network_taps.Element.tags - tags.Element = AAZStrArg() - - _schema.application_gateway_backend_address_pools = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools - _schema.application_security_groups = cls._args_network_interface_ip_configuration_update.application_security_groups - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_update.name - _schema.primary = cls._args_network_interface_ip_configuration_update.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_update.private_ip_address - _schema.private_ip_address_version = cls._args_network_interface_ip_configuration_update.private_ip_address_version - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_update.private_ip_allocation_method - _schema.public_ip_address = cls._args_network_interface_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_update.subnet - _schema.virtual_network_taps = cls._args_network_interface_ip_configuration_update.virtual_network_taps - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg() - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - network_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - network_security_group_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_update(default_security_rules.Element) - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg() - - _element = cls._args_network_security_group_update.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - _element.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - _element.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - _element.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - _element.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - _element.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_network_security_group_update.security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_network_security_group_update.security_rules.Element.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_network_security_group_update.security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_network_security_group_update.security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_network_security_group_update.security_rules.Element.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_network_security_group_update.security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg() - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.tags = cls._args_network_security_group_update.tags - - _args_public_ip_address_update = None - - @classmethod - def _build_args_public_ip_address_update(cls, _schema): - if cls._args_public_ip_address_update is not None: - _schema.ddos_settings = cls._args_public_ip_address_update.ddos_settings - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.id = cls._args_public_ip_address_update.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.ip_tags = cls._args_public_ip_address_update.ip_tags - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_address_version = cls._args_public_ip_address_update.public_ip_address_version - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.public_ip_prefix = cls._args_public_ip_address_update.public_ip_prefix - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.sku = cls._args_public_ip_address_update.sku - _schema.tags = cls._args_public_ip_address_update.tags - _schema.zones = cls._args_public_ip_address_update.zones - return - - cls._args_public_ip_address_update = AAZObjectArg() - - public_ip_address_update = cls._args_public_ip_address_update - public_ip_address_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - public_ip_address_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_update.ddos_settings = AAZObjectArg( - options=["ddos-settings"], - help="The DDoS protection custom policy associated with the public IP address.", - ) - public_ip_address_update.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - ) - public_ip_address_update.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - ) - public_ip_address_update.ip_address = AAZStrArg( - options=["ip-address"], - help="The IP address associated with the public IP address resource.", - ) - public_ip_address_update.ip_tags = AAZListArg( - options=["ip-tags"], - help="The list of tags associated with the public IP address.", - ) - public_ip_address_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - public_ip_address_update.public_ip_address_version = AAZStrArg( - options=["public-ip-address-version"], - help="The public IP address version. Possible values are: 'IPv4' and 'IPv6'.", - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - public_ip_address_update.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_update.public_ip_prefix = AAZObjectArg( - options=["public-ip-prefix"], - help="The Public IP Prefix this Public IP Address should be allocated from.", - ) - cls._build_args_sub_resource_update(public_ip_address_update.public_ip_prefix) - public_ip_address_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - ) - public_ip_address_update.sku = AAZObjectArg( - options=["sku"], - help="The public IP address SKU.", - ) - public_ip_address_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - public_ip_address_update.zones = AAZListArg( - options=["zones"], - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - ) - - ddos_settings = cls._args_public_ip_address_update.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectArg( - options=["ddos-custom-policy"], - help="The DDoS custom policy associated with the public IP.", - ) - cls._build_args_sub_resource_update(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrArg( - options=["protection-coverage"], - help="The DDoS protection policy customizability of the public IP. Only standard coverage will have the ability to be customized.", - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - - dns_settings = cls._args_public_ip_address_update.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - ) - - ip_tags = cls._args_public_ip_address_update.ip_tags - ip_tags.Element = AAZObjectArg() - - _element = cls._args_public_ip_address_update.ip_tags.Element - _element.ip_tag_type = AAZStrArg( - options=["ip-tag-type"], - help="Gets or sets the ipTag type: Example FirstPartyUsage.", - ) - _element.tag = AAZStrArg( - options=["tag"], - help="Gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc", - ) - - sku = cls._args_public_ip_address_update.sku - sku.name = AAZStrArg( - options=["name"], - help="Name of a public IP address SKU.", - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - - tags = cls._args_public_ip_address_update.tags - tags.Element = AAZStrArg() - - zones = cls._args_public_ip_address_update.zones - zones.Element = AAZStrArg() - - _schema.ddos_settings = cls._args_public_ip_address_update.ddos_settings - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.id = cls._args_public_ip_address_update.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.ip_tags = cls._args_public_ip_address_update.ip_tags - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_address_version = cls._args_public_ip_address_update.public_ip_address_version - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.public_ip_prefix = cls._args_public_ip_address_update.public_ip_prefix - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.sku = cls._args_public_ip_address_update.sku - _schema.tags = cls._args_public_ip_address_update.tags - _schema.zones = cls._args_public_ip_address_update.zones - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg() - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg() - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_subnet_update = None - - @classmethod - def _build_args_subnet_update(cls, _schema): - if cls._args_subnet_update is not None: - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.address_prefixes = cls._args_subnet_update.address_prefixes - _schema.delegations = cls._args_subnet_update.delegations - _schema.id = cls._args_subnet_update.id - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.resource_navigation_links = cls._args_subnet_update.resource_navigation_links - _schema.route_table = cls._args_subnet_update.route_table - _schema.service_association_links = cls._args_subnet_update.service_association_links - _schema.service_endpoint_policies = cls._args_subnet_update.service_endpoint_policies - _schema.service_endpoints = cls._args_subnet_update.service_endpoints - return - - cls._args_subnet_update = AAZObjectArg() - - subnet_update = cls._args_subnet_update - subnet_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}", - ), - ) - subnet_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - subnet_update.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - subnet_update.address_prefixes = AAZListArg( - options=["address-prefixes"], - help="List of address prefixes for the subnet.", - ) - subnet_update.delegations = AAZListArg( - options=["delegations"], - help="Gets an array of references to the delegations on the subnet.", - ) - subnet_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - ) - cls._build_args_network_security_group_update(subnet_update.network_security_group) - subnet_update.resource_navigation_links = AAZListArg( - options=["resource-navigation-links"], - help="Gets an array of references to the external resources using subnet.", - ) - subnet_update.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - ) - subnet_update.service_association_links = AAZListArg( - options=["service-association-links"], - help="Gets an array of references to services injecting into this subnet.", - ) - subnet_update.service_endpoint_policies = AAZListArg( - options=["service-endpoint-policies"], - help="An array of service endpoint policies.", - ) - subnet_update.service_endpoints = AAZListArg( - options=["service-endpoints"], - help="An array of service endpoints.", - ) - - address_prefixes = cls._args_subnet_update.address_prefixes - address_prefixes.Element = AAZStrArg() - - delegations = cls._args_subnet_update.delegations - delegations.Element = AAZObjectArg() - - _element = cls._args_subnet_update.delegations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a subnet. This name can be used to access the resource.", - ) - _element.actions = AAZListArg( - options=["actions"], - help="Describes the actions permitted to the service upon delegation", - ) - _element.service_name = AAZStrArg( - options=["service-name"], - help="The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers)", - ) - - actions = cls._args_subnet_update.delegations.Element.actions - actions.Element = AAZStrArg() - - resource_navigation_links = cls._args_subnet_update.resource_navigation_links - resource_navigation_links.Element = AAZObjectArg() - - _element = cls._args_subnet_update.resource_navigation_links.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.link = AAZStrArg( - options=["link"], - help="Link to the external resource", - ) - _element.linked_resource_type = AAZStrArg( - options=["linked-resource-type"], - help="Resource type of the linked resource.", - ) - - route_table = cls._args_subnet_update.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.disable_bgp_route_propagation = AAZBoolArg( - options=["disable-bgp-route-propagation"], - help="Gets or sets whether to disable the routes learned by BGP on that route table. True means disable.", - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_subnet_update.route_table.routes - routes.Element = AAZObjectArg() - - _element = cls._args_subnet_update.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - tags = cls._args_subnet_update.route_table.tags - tags.Element = AAZStrArg() - - service_association_links = cls._args_subnet_update.service_association_links - service_association_links.Element = AAZObjectArg() - - _element = cls._args_subnet_update.service_association_links.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.link = AAZStrArg( - options=["link"], - help="Link to the external resource.", - ) - _element.linked_resource_type = AAZStrArg( - options=["linked-resource-type"], - help="Resource type of the linked resource.", - ) - - service_endpoint_policies = cls._args_subnet_update.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectArg() - - _element = cls._args_subnet_update.service_endpoint_policies.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.service_endpoint_policy_definitions = AAZListArg( - options=["service-endpoint-policy-definitions"], - help="A collection of service endpoint policy definitions of the service endpoint policy.", - ) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - service_endpoint_policy_definitions = cls._args_subnet_update.service_endpoint_policies.Element.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectArg() - - _element = cls._args_subnet_update.service_endpoint_policies.Element.service_endpoint_policy_definitions.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}/serviceEndpointPolicyDefinitions/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.service = AAZStrArg( - options=["service"], - help="service endpoint name.", - ) - _element.service_resources = AAZListArg( - options=["service-resources"], - help="A list of service resources.", - ) - - service_resources = cls._args_subnet_update.service_endpoint_policies.Element.service_endpoint_policy_definitions.Element.service_resources - service_resources.Element = AAZStrArg() - - tags = cls._args_subnet_update.service_endpoint_policies.Element.tags - tags.Element = AAZStrArg() - - service_endpoints = cls._args_subnet_update.service_endpoints - service_endpoints.Element = AAZObjectArg() - - _element = cls._args_subnet_update.service_endpoints.Element - _element.locations = AAZListArg( - options=["locations"], - help="A list of locations.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - ) - _element.service = AAZStrArg( - options=["service"], - help="The type of the endpoint service.", - ) - - locations = cls._args_subnet_update.service_endpoints.Element.locations - locations.Element = AAZStrArg() - - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.address_prefixes = cls._args_subnet_update.address_prefixes - _schema.delegations = cls._args_subnet_update.delegations - _schema.id = cls._args_subnet_update.id - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.resource_navigation_links = cls._args_subnet_update.resource_navigation_links - _schema.route_table = cls._args_subnet_update.route_table - _schema.service_association_links = cls._args_subnet_update.service_association_links - _schema.service_endpoint_policies = cls._args_subnet_update.service_endpoint_policies - _schema.service_endpoints = cls._args_subnet_update.service_endpoints - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("applicationGatewayBackendAddressPools", AAZListType, ".application_gateway_backend_address_pools") - properties.set_prop("applicationSecurityGroups", AAZListType, ".asgs_obj") - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".make_primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAddressVersion", AAZStrType, ".private_ip_address_version") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType) - properties.set_prop("subnet", AAZObjectType) - - application_gateway_backend_address_pools = _builder.get(".properties.applicationGatewayBackendAddressPools") - if application_gateway_backend_address_pools is not None: - application_gateway_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationGatewayBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - application_security_groups = _builder.get(".properties.applicationSecurityGroups") - if application_security_groups is not None: - application_security_groups.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationSecurityGroups[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".properties.applicationSecurityGroups[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - public_ip_address = _builder.get(".properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".public_ip_address") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - subnet = _builder.get(".properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_interface_ip_configuration_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("applicationGatewayBackendAddressPools", AAZListType, ".application_gateway_backend_address_pools") - properties.set_prop("applicationSecurityGroups", AAZListType, ".application_security_groups") - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAddressVersion", AAZStrType, ".private_ip_address_version") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - properties.set_prop("virtualNetworkTaps", AAZListType, ".virtual_network_taps") - - application_gateway_backend_address_pools = _builder.get(".properties.applicationGatewayBackendAddressPools") - if application_gateway_backend_address_pools is not None: - application_gateway_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationGatewayBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("type", AAZStrType, ".type") - - properties = _builder.get(".properties.applicationGatewayBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("backendAddresses", AAZListType, ".backend_addresses") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - backend_addresses = _builder.get(".properties.applicationGatewayBackendAddressPools[].properties.backendAddresses") - if backend_addresses is not None: - backend_addresses.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationGatewayBackendAddressPools[].properties.backendAddresses[]") - if _elements is not None: - _elements.set_prop("fqdn", AAZStrType, ".fqdn") - _elements.set_prop("ipAddress", AAZStrType, ".ip_address") - - application_security_groups = _builder.get(".properties.applicationSecurityGroups") - if application_security_groups is not None: - cls._build_schema_application_security_group_update(application_security_groups.set_elements(AAZObjectType, ".")) - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - cls._build_schema_sub_resource_update(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - virtual_network_taps = _builder.get(".properties.virtualNetworkTaps") - if virtual_network_taps is not None: - virtual_network_taps.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.virtualNetworkTaps[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.virtualNetworkTaps[].properties") - if properties is not None: - properties.set_prop("destinationLoadBalancerFrontEndIPConfiguration", AAZObjectType, ".destination_load_balancer_front_end_ip_configuration") - cls._build_schema_network_interface_ip_configuration_update(properties.set_prop("destinationNetworkInterfaceIPConfiguration", AAZObjectType, ".destination_network_interface_ip_configuration")) - properties.set_prop("destinationPort", AAZIntType, ".destination_port") - - destination_load_balancer_front_end_ip_configuration = _builder.get(".properties.virtualNetworkTaps[].properties.destinationLoadBalancerFrontEndIPConfiguration") - if destination_load_balancer_front_end_ip_configuration is not None: - destination_load_balancer_front_end_ip_configuration.set_prop("etag", AAZStrType, ".etag") - destination_load_balancer_front_end_ip_configuration.set_prop("id", AAZStrType, ".id") - destination_load_balancer_front_end_ip_configuration.set_prop("name", AAZStrType, ".name") - destination_load_balancer_front_end_ip_configuration.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - destination_load_balancer_front_end_ip_configuration.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties.virtualNetworkTaps[].properties.destinationLoadBalancerFrontEndIPConfiguration.properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_sub_resource_update(properties.set_prop("publicIPPrefix", AAZObjectType, ".public_ip_prefix")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - zones = _builder.get(".properties.virtualNetworkTaps[].properties.destinationLoadBalancerFrontEndIPConfiguration.zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.virtualNetworkTaps[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.securityRules[].properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.securityRules[].properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.securityRules[].properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.securityRules[].properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.securityRules[].properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.securityRules[].properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("sku", AAZObjectType, ".sku") - _builder.set_prop("tags", AAZDictType, ".tags") - _builder.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("ddosSettings", AAZObjectType, ".ddos_settings") - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("ipTags", AAZListType, ".ip_tags") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAddressVersion", AAZStrType, ".public_ip_address_version") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - cls._build_schema_sub_resource_update(properties.set_prop("publicIPPrefix", AAZObjectType, ".public_ip_prefix")) - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - ddos_settings = _builder.get(".properties.ddosSettings") - if ddos_settings is not None: - cls._build_schema_sub_resource_update(ddos_settings.set_prop("ddosCustomPolicy", AAZObjectType, ".ddos_custom_policy")) - ddos_settings.set_prop("protectionCoverage", AAZStrType, ".protection_coverage") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - ip_tags = _builder.get(".properties.ipTags") - if ip_tags is not None: - ip_tags.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipTags[]") - if _elements is not None: - _elements.set_prop("ipTagType", AAZStrType, ".ip_tag_type") - _elements.set_prop("tag", AAZStrType, ".tag") - - sku = _builder.get(".sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".name") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - zones = _builder.get(".zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - properties.set_prop("delegations", AAZListType, ".delegations") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("resourceNavigationLinks", AAZListType, ".resource_navigation_links") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - properties.set_prop("serviceAssociationLinks", AAZListType, ".service_association_links") - properties.set_prop("serviceEndpointPolicies", AAZListType, ".service_endpoint_policies") - properties.set_prop("serviceEndpoints", AAZListType, ".service_endpoints") - - address_prefixes = _builder.get(".properties.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - delegations = _builder.get(".properties.delegations") - if delegations is not None: - delegations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.delegations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.delegations[].properties") - if properties is not None: - properties.set_prop("actions", AAZListType, ".actions") - properties.set_prop("serviceName", AAZStrType, ".service_name") - - actions = _builder.get(".properties.delegations[].properties.actions") - if actions is not None: - actions.set_elements(AAZStrType, ".") - - resource_navigation_links = _builder.get(".properties.resourceNavigationLinks") - if resource_navigation_links is not None: - resource_navigation_links.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.resourceNavigationLinks[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.resourceNavigationLinks[].properties") - if properties is not None: - properties.set_prop("link", AAZStrType, ".link") - properties.set_prop("linkedResourceType", AAZStrType, ".linked_resource_type") - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("disableBgpRoutePropagation", AAZBoolType, ".disable_bgp_route_propagation") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - service_association_links = _builder.get(".properties.serviceAssociationLinks") - if service_association_links is not None: - service_association_links.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceAssociationLinks[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.serviceAssociationLinks[].properties") - if properties is not None: - properties.set_prop("link", AAZStrType, ".link") - properties.set_prop("linkedResourceType", AAZStrType, ".linked_resource_type") - - service_endpoint_policies = _builder.get(".properties.serviceEndpointPolicies") - if service_endpoint_policies is not None: - service_endpoint_policies.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpointPolicies[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.serviceEndpointPolicies[].properties") - if properties is not None: - properties.set_prop("serviceEndpointPolicyDefinitions", AAZListType, ".service_endpoint_policy_definitions") - - service_endpoint_policy_definitions = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions") - if service_endpoint_policy_definitions is not None: - service_endpoint_policy_definitions.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties") - if properties is not None: - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("service", AAZStrType, ".service") - properties.set_prop("serviceResources", AAZListType, ".service_resources") - - service_resources = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties.serviceResources") - if service_resources is not None: - service_resources.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.serviceEndpointPolicies[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - service_endpoints = _builder.get(".properties.serviceEndpoints") - if service_endpoints is not None: - service_endpoints.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpoints[]") - if _elements is not None: - _elements.set_prop("locations", AAZListType, ".locations") - _elements.set_prop("provisioningState", AAZStrType, ".provisioning_state") - _elements.set_prop("service", AAZStrType, ".service") - - locations = _builder.get(".properties.serviceEndpoints[].locations") - if locations is not None: - locations.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_delete.py deleted file mode 100644 index 800c76fcf48..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_delete.py +++ /dev/null @@ -1,1589 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config delete", -) -class Delete(AAZCommand): - """Delete an IP configuration. - - An NIC must have at least one IP configuration. - - :example: Delete an IP configuration. - az network nic ip-config delete -g MyResourceGroup -n MyIpConfig --nic-name MyNic - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01", "properties.ipConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the IP configuration.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_list.py deleted file mode 100644 index 2cd399a4849..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_list.py +++ /dev/null @@ -1,1443 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config list", -) -class List(AAZCommand): - """List the IP configurations of an NIC. - - :example: List the IP configurations of an NIC. - az network nic ip-config list -g MyResourceGroup --nic-name MyNic - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01", "properties.ipConfigurations"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.ipConfigurations - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.ipConfigurations = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_show.py deleted file mode 100644 index 3daf9ce0d0b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_show.py +++ /dev/null @@ -1,1462 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config show", -) -class Show(AAZCommand): - """Show the details of an IP configuration. - - :example: Show the details of an IP configuration of an NIC. - az network nic ip-config show -g MyResourceGroup -n MyIpConfig --nic-name MyNic - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01", "properties.ipConfigurations[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the IP configuration.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_update.py deleted file mode 100644 index 09f306a5980..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_update.py +++ /dev/null @@ -1,3797 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config update", -) -class Update(AAZCommand): - """Update an IP configuration. - - :example: Update a NIC to use a new private IP address. - az network nic ip-config update -g MyResourceGroup --nic-name MyNic -n MyIpConfig --private-ip-address 10.0.0.9 - - :example: Make an IP configuration the default for the supplied NIC. - az network nic ip-config update -g MyResourceGroup --nic-name MyNic -n MyIpConfig --make-primary - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01", "properties.ipConfigurations[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the IP configuration.", - required=True, - ) - - # define Arg Group "IP Configuration" - - _args_schema = cls._args_schema - _args_schema.make_primary = AAZBoolArg( - options=["--make-primary"], - arg_group="IP Configuration", - help="Set to make this configuration the primary one for the NIC.", - nullable=True, - ) - _args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="IP Configuration", - help="Static IP address to use or \"\"('\"\"' in PowerShell) to use a dynamic address.", - nullable=True, - ) - _args_schema.private_ip_address_version = AAZStrArg( - options=["--private-ip-address-version"], - arg_group="IP Configuration", - help="Version of private IP address to use.", - nullable=True, - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - _args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="IP Configuration", - help="Name or ID of an existing public IP address.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - _args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="IP Configuration", - help="Name or ID of an existing subnet. If name specified, please also specify `--vnet-name`.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}", - ), - ) - - # define Arg Group "Parameters.properties.ipConfigurations[]" - - # define Arg Group "PipObj" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.application_gateway_backend_address_pools = AAZListArg( - options=["--application-gateway-backend-address-pools"], - arg_group="Properties", - help="The reference to ApplicationGatewayBackendAddressPool resource.", - nullable=True, - ) - _args_schema.asgs_obj = AAZListArg( - options=["--asgs-obj"], - arg_group="Properties", - help="Application security groups in which the IP configuration is included.", - nullable=True, - ) - _args_schema.load_balancer_backend_address_pools = AAZListArg( - options=["--load-balancer-backend-address-pools"], - arg_group="Properties", - help="The reference to LoadBalancerBackendAddressPool resource.", - nullable=True, - ) - _args_schema.load_balancer_inbound_nat_rules = AAZListArg( - options=["--load-balancer-inbound-nat-rules"], - arg_group="Properties", - help="A list of references of LoadBalancerInboundNatRules.", - nullable=True, - ) - _args_schema.private_ip_allocation_method = AAZStrArg( - options=["--private-ip-allocation-method"], - arg_group="Properties", - help="The private IP address allocation method.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - - application_gateway_backend_address_pools = cls._args_schema.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.application_gateway_backend_address_pools.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the backend address pool that is unique within an Application Gateway.", - nullable=True, - ) - - asgs_obj = cls._args_schema.asgs_obj - asgs_obj.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.asgs_obj.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_schema.asgs_obj.Element.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - load_balancer_backend_address_pools = cls._args_schema.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.load_balancer_backend_address_pools.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resource.", - nullable=True, - ) - - load_balancer_inbound_nat_rules = cls._args_schema.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.load_balancer_inbound_nat_rules.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource.", - nullable=True, - ) - - # define Arg Group "PublicIPAddress" - - # define Arg Group "Subnet" - - # define Arg Group "SubnetObj" - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_network_interface_ip_configuration_update = None - - @classmethod - def _build_args_network_interface_ip_configuration_update(cls, _schema): - if cls._args_network_interface_ip_configuration_update is not None: - _schema.application_gateway_backend_address_pools = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools - _schema.application_security_groups = cls._args_network_interface_ip_configuration_update.application_security_groups - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_update.name - _schema.primary = cls._args_network_interface_ip_configuration_update.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_update.private_ip_address - _schema.private_ip_address_version = cls._args_network_interface_ip_configuration_update.private_ip_address_version - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_update.private_ip_allocation_method - _schema.public_ip_address = cls._args_network_interface_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_update.subnet - _schema.virtual_network_taps = cls._args_network_interface_ip_configuration_update.virtual_network_taps - return - - cls._args_network_interface_ip_configuration_update = AAZObjectArg( - nullable=True, - ) - - network_interface_ip_configuration_update = cls._args_network_interface_ip_configuration_update - network_interface_ip_configuration_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - network_interface_ip_configuration_update.application_gateway_backend_address_pools = AAZListArg( - options=["application-gateway-backend-address-pools"], - help="The reference of ApplicationGatewayBackendAddressPool resource.", - nullable=True, - ) - network_interface_ip_configuration_update.application_security_groups = AAZListArg( - options=["application-security-groups"], - help="Application security groups in which the IP configuration is included.", - nullable=True, - ) - network_interface_ip_configuration_update.load_balancer_backend_address_pools = AAZListArg( - options=["load-balancer-backend-address-pools"], - help="The reference of LoadBalancerBackendAddressPool resource.", - nullable=True, - ) - network_interface_ip_configuration_update.load_balancer_inbound_nat_rules = AAZListArg( - options=["load-balancer-inbound-nat-rules"], - help="A list of references of LoadBalancerInboundNatRules.", - nullable=True, - ) - network_interface_ip_configuration_update.primary = AAZBoolArg( - options=["primary"], - help="Gets whether this is a primary customer address on the network interface.", - nullable=True, - ) - network_interface_ip_configuration_update.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="Private IP address of the IP configuration.", - nullable=True, - ) - network_interface_ip_configuration_update.private_ip_address_version = AAZStrArg( - options=["private-ip-address-version"], - help="Available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'.", - nullable=True, - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - network_interface_ip_configuration_update.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - network_interface_ip_configuration_update.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="Public IP address bound to the IP configuration.", - nullable=True, - ) - cls._build_args_public_ip_address_update(network_interface_ip_configuration_update.public_ip_address) - network_interface_ip_configuration_update.subnet = AAZObjectArg( - options=["subnet"], - help="Subnet bound to the IP configuration.", - nullable=True, - ) - cls._build_args_subnet_update(network_interface_ip_configuration_update.subnet) - network_interface_ip_configuration_update.virtual_network_taps = AAZListArg( - options=["virtual-network-taps"], - help="The reference to Virtual Network Taps.", - nullable=True, - ) - - application_gateway_backend_address_pools = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the backend address pool that is unique within an Application Gateway.", - nullable=True, - ) - _element.backend_addresses = AAZListArg( - options=["backend-addresses"], - help="Backend addresses", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.type = AAZStrArg( - options=["type"], - help="Type of the resource.", - nullable=True, - ) - - backend_addresses = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools.Element.backend_addresses - backend_addresses.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools.Element.backend_addresses.Element - _element.fqdn = AAZStrArg( - options=["fqdn"], - help="Fully qualified domain name (FQDN).", - nullable=True, - ) - _element.ip_address = AAZStrArg( - options=["ip-address"], - help="IP address", - nullable=True, - ) - - application_security_groups = cls._args_network_interface_ip_configuration_update.application_security_groups - application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(application_security_groups.Element) - - load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="Gets name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.backend_port = AAZIntArg( - options=["backend-port"], - help="The port used for the internal endpoint. Acceptable values range from 1 to 65535.", - nullable=True, - ) - _element.enable_floating_ip = AAZBoolArg( - options=["enable-floating-ip"], - help="Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint.", - nullable=True, - ) - _element.enable_tcp_reset = AAZBoolArg( - options=["enable-tcp-reset"], - help="Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _element.frontend_ip_configuration = AAZObjectArg( - options=["frontend-ip-configuration"], - help="A reference to frontend IP addresses.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.frontend_ip_configuration) - _element.frontend_port = AAZIntArg( - options=["frontend-port"], - help="The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534.", - nullable=True, - ) - _element.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="The transport protocol for the endpoint. Possible values are 'Udp' or 'Tcp' or 'All'.", - nullable=True, - enum={"All": "All", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - virtual_network_taps = cls._args_network_interface_ip_configuration_update.virtual_network_taps - virtual_network_taps.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_interface_ip_configuration_update.virtual_network_taps.Element - _element.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworkTaps/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.destination_load_balancer_front_end_ip_configuration = AAZObjectArg( - options=["destination-load-balancer-front-end-ip-configuration"], - help="The reference to the private IP address on the internal Load Balancer that will receive the tap", - nullable=True, - ) - _element.destination_network_interface_ip_configuration = AAZObjectArg( - options=["destination-network-interface-ip-configuration"], - help="The reference to the private IP Address of the collector nic that will receive the tap", - nullable=True, - ) - cls._build_args_network_interface_ip_configuration_update(_element.destination_network_interface_ip_configuration) - _element.destination_port = AAZIntArg( - options=["destination-port"], - help="The VXLAN destination port that will receive the tapped traffic.", - nullable=True, - ) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - destination_load_balancer_front_end_ip_configuration = cls._args_network_interface_ip_configuration_update.virtual_network_taps.Element.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - destination_load_balancer_front_end_ip_configuration.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/frontendIPConfigurations/{}", - ), - ) - destination_load_balancer_front_end_ip_configuration.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - destination_load_balancer_front_end_ip_configuration.private_ip_address = AAZStrArg( - options=["private-ip-address"], - help="The private IP address of the IP configuration.", - nullable=True, - ) - destination_load_balancer_front_end_ip_configuration.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The Private IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - destination_load_balancer_front_end_ip_configuration.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - destination_load_balancer_front_end_ip_configuration.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference of the Public IP resource.", - nullable=True, - ) - cls._build_args_public_ip_address_update(destination_load_balancer_front_end_ip_configuration.public_ip_address) - destination_load_balancer_front_end_ip_configuration.public_ip_prefix = AAZObjectArg( - options=["public-ip-prefix"], - help="The reference of the Public IP Prefix resource.", - nullable=True, - ) - cls._build_args_sub_resource_update(destination_load_balancer_front_end_ip_configuration.public_ip_prefix) - destination_load_balancer_front_end_ip_configuration.subnet = AAZObjectArg( - options=["subnet"], - help="The reference of the subnet resource.", - nullable=True, - ) - cls._build_args_subnet_update(destination_load_balancer_front_end_ip_configuration.subnet) - destination_load_balancer_front_end_ip_configuration.zones = AAZListArg( - options=["zones"], - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - nullable=True, - ) - - zones = cls._args_network_interface_ip_configuration_update.virtual_network_taps.Element.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrArg( - nullable=True, - ) - - tags = cls._args_network_interface_ip_configuration_update.virtual_network_taps.Element.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.application_gateway_backend_address_pools = cls._args_network_interface_ip_configuration_update.application_gateway_backend_address_pools - _schema.application_security_groups = cls._args_network_interface_ip_configuration_update.application_security_groups - _schema.load_balancer_backend_address_pools = cls._args_network_interface_ip_configuration_update.load_balancer_backend_address_pools - _schema.load_balancer_inbound_nat_rules = cls._args_network_interface_ip_configuration_update.load_balancer_inbound_nat_rules - _schema.name = cls._args_network_interface_ip_configuration_update.name - _schema.primary = cls._args_network_interface_ip_configuration_update.primary - _schema.private_ip_address = cls._args_network_interface_ip_configuration_update.private_ip_address - _schema.private_ip_address_version = cls._args_network_interface_ip_configuration_update.private_ip_address_version - _schema.private_ip_allocation_method = cls._args_network_interface_ip_configuration_update.private_ip_allocation_method - _schema.public_ip_address = cls._args_network_interface_ip_configuration_update.public_ip_address - _schema.subnet = cls._args_network_interface_ip_configuration_update.subnet - _schema.virtual_network_taps = cls._args_network_interface_ip_configuration_update.virtual_network_taps - - _args_network_security_group_update = None - - @classmethod - def _build_args_network_security_group_update(cls, _schema): - if cls._args_network_security_group_update is not None: - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.tags = cls._args_network_security_group_update.tags - return - - cls._args_network_security_group_update = AAZObjectArg( - nullable=True, - ) - - network_security_group_update = cls._args_network_security_group_update - network_security_group_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - network_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group_update.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - nullable=True, - ) - network_security_group_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - network_security_group_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - nullable=True, - ) - network_security_group_update.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - nullable=True, - ) - network_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - default_security_rules = cls._args_network_security_group_update.default_security_rules - default_security_rules.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_security_rule_update(default_security_rules.Element) - - security_rules = cls._args_network_security_group_update.security_rules - security_rules.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_network_security_group_update.security_rules.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - _element.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - _element.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - _element.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - _element.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - _element.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - _element.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_network_security_group_update.security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_network_security_group_update.security_rules.Element.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_network_security_group_update.security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_network_security_group_update.security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_network_security_group_update.security_rules.Element.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_network_security_group_update.security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - tags = cls._args_network_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.default_security_rules = cls._args_network_security_group_update.default_security_rules - _schema.etag = cls._args_network_security_group_update.etag - _schema.id = cls._args_network_security_group_update.id - _schema.location = cls._args_network_security_group_update.location - _schema.provisioning_state = cls._args_network_security_group_update.provisioning_state - _schema.resource_guid = cls._args_network_security_group_update.resource_guid - _schema.security_rules = cls._args_network_security_group_update.security_rules - _schema.tags = cls._args_network_security_group_update.tags - - _args_public_ip_address_update = None - - @classmethod - def _build_args_public_ip_address_update(cls, _schema): - if cls._args_public_ip_address_update is not None: - _schema.ddos_settings = cls._args_public_ip_address_update.ddos_settings - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.id = cls._args_public_ip_address_update.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.ip_tags = cls._args_public_ip_address_update.ip_tags - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_address_version = cls._args_public_ip_address_update.public_ip_address_version - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.public_ip_prefix = cls._args_public_ip_address_update.public_ip_prefix - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.sku = cls._args_public_ip_address_update.sku - _schema.tags = cls._args_public_ip_address_update.tags - _schema.zones = cls._args_public_ip_address_update.zones - return - - cls._args_public_ip_address_update = AAZObjectArg( - nullable=True, - ) - - public_ip_address_update = cls._args_public_ip_address_update - public_ip_address_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - public_ip_address_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/publicIPAddresses/{}", - ), - ) - public_ip_address_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - public_ip_address_update.ddos_settings = AAZObjectArg( - options=["ddos-settings"], - help="The DDoS protection custom policy associated with the public IP address.", - nullable=True, - ) - public_ip_address_update.dns_settings = AAZObjectArg( - options=["dns-settings"], - help="The FQDN of the DNS record associated with the public IP address.", - nullable=True, - ) - public_ip_address_update.idle_timeout_in_minutes = AAZIntArg( - options=["idle-timeout-in-minutes"], - help="The idle timeout of the public IP address.", - nullable=True, - ) - public_ip_address_update.ip_address = AAZStrArg( - options=["ip-address"], - help="The IP address associated with the public IP address resource.", - nullable=True, - ) - public_ip_address_update.ip_tags = AAZListArg( - options=["ip-tags"], - help="The list of tags associated with the public IP address.", - nullable=True, - ) - public_ip_address_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - public_ip_address_update.public_ip_address_version = AAZStrArg( - options=["public-ip-address-version"], - help="The public IP address version. Possible values are: 'IPv4' and 'IPv6'.", - nullable=True, - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - public_ip_address_update.public_ip_allocation_method = AAZStrArg( - options=["public-ip-allocation-method"], - help="The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - public_ip_address_update.public_ip_prefix = AAZObjectArg( - options=["public-ip-prefix"], - help="The Public IP Prefix this Public IP Address should be allocated from.", - nullable=True, - ) - cls._build_args_sub_resource_update(public_ip_address_update.public_ip_prefix) - public_ip_address_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the public IP resource.", - nullable=True, - ) - public_ip_address_update.sku = AAZObjectArg( - options=["sku"], - help="The public IP address SKU.", - nullable=True, - ) - public_ip_address_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - public_ip_address_update.zones = AAZListArg( - options=["zones"], - help="A list of availability zones denoting the IP allocated for the resource needs to come from.", - nullable=True, - ) - - ddos_settings = cls._args_public_ip_address_update.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectArg( - options=["ddos-custom-policy"], - help="The DDoS custom policy associated with the public IP.", - nullable=True, - ) - cls._build_args_sub_resource_update(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrArg( - options=["protection-coverage"], - help="The DDoS protection policy customizability of the public IP. Only standard coverage will have the ability to be customized.", - nullable=True, - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - - dns_settings = cls._args_public_ip_address_update.dns_settings - dns_settings.domain_name_label = AAZStrArg( - options=["domain-name-label"], - help="Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.", - nullable=True, - ) - dns_settings.fqdn = AAZStrArg( - options=["fqdn"], - help="Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone.", - nullable=True, - ) - dns_settings.reverse_fqdn = AAZStrArg( - options=["reverse-fqdn"], - help="Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. ", - nullable=True, - ) - - ip_tags = cls._args_public_ip_address_update.ip_tags - ip_tags.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_public_ip_address_update.ip_tags.Element - _element.ip_tag_type = AAZStrArg( - options=["ip-tag-type"], - help="Gets or sets the ipTag type: Example FirstPartyUsage.", - nullable=True, - ) - _element.tag = AAZStrArg( - options=["tag"], - help="Gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc", - nullable=True, - ) - - sku = cls._args_public_ip_address_update.sku - sku.name = AAZStrArg( - options=["name"], - help="Name of a public IP address SKU.", - nullable=True, - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - - tags = cls._args_public_ip_address_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - zones = cls._args_public_ip_address_update.zones - zones.Element = AAZStrArg( - nullable=True, - ) - - _schema.ddos_settings = cls._args_public_ip_address_update.ddos_settings - _schema.dns_settings = cls._args_public_ip_address_update.dns_settings - _schema.etag = cls._args_public_ip_address_update.etag - _schema.id = cls._args_public_ip_address_update.id - _schema.idle_timeout_in_minutes = cls._args_public_ip_address_update.idle_timeout_in_minutes - _schema.ip_address = cls._args_public_ip_address_update.ip_address - _schema.ip_tags = cls._args_public_ip_address_update.ip_tags - _schema.location = cls._args_public_ip_address_update.location - _schema.provisioning_state = cls._args_public_ip_address_update.provisioning_state - _schema.public_ip_address_version = cls._args_public_ip_address_update.public_ip_address_version - _schema.public_ip_allocation_method = cls._args_public_ip_address_update.public_ip_allocation_method - _schema.public_ip_prefix = cls._args_public_ip_address_update.public_ip_prefix - _schema.resource_guid = cls._args_public_ip_address_update.resource_guid - _schema.sku = cls._args_public_ip_address_update.sku - _schema.tags = cls._args_public_ip_address_update.tags - _schema.zones = cls._args_public_ip_address_update.zones - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_subnet_update = None - - @classmethod - def _build_args_subnet_update(cls, _schema): - if cls._args_subnet_update is not None: - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.address_prefixes = cls._args_subnet_update.address_prefixes - _schema.delegations = cls._args_subnet_update.delegations - _schema.id = cls._args_subnet_update.id - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.resource_navigation_links = cls._args_subnet_update.resource_navigation_links - _schema.route_table = cls._args_subnet_update.route_table - _schema.service_association_links = cls._args_subnet_update.service_association_links - _schema.service_endpoint_policies = cls._args_subnet_update.service_endpoint_policies - _schema.service_endpoints = cls._args_subnet_update.service_endpoints - return - - cls._args_subnet_update = AAZObjectArg( - nullable=True, - ) - - subnet_update = cls._args_subnet_update - subnet_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/virtualNetworks/{}/subnets/{}", - ), - ) - subnet_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - subnet_update.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - nullable=True, - ) - subnet_update.address_prefixes = AAZListArg( - options=["address-prefixes"], - help="List of address prefixes for the subnet.", - nullable=True, - ) - subnet_update.delegations = AAZListArg( - options=["delegations"], - help="Gets an array of references to the delegations on the subnet.", - nullable=True, - ) - subnet_update.network_security_group = AAZObjectArg( - options=["network-security-group"], - help="The reference of the NetworkSecurityGroup resource.", - nullable=True, - ) - cls._build_args_network_security_group_update(subnet_update.network_security_group) - subnet_update.resource_navigation_links = AAZListArg( - options=["resource-navigation-links"], - help="Gets an array of references to the external resources using subnet.", - nullable=True, - ) - subnet_update.route_table = AAZObjectArg( - options=["route-table"], - help="The reference of the RouteTable resource.", - nullable=True, - ) - subnet_update.service_association_links = AAZListArg( - options=["service-association-links"], - help="Gets an array of references to services injecting into this subnet.", - nullable=True, - ) - subnet_update.service_endpoint_policies = AAZListArg( - options=["service-endpoint-policies"], - help="An array of service endpoint policies.", - nullable=True, - ) - subnet_update.service_endpoints = AAZListArg( - options=["service-endpoints"], - help="An array of service endpoints.", - nullable=True, - ) - - address_prefixes = cls._args_subnet_update.address_prefixes - address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - delegations = cls._args_subnet_update.delegations - delegations.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.delegations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a subnet. This name can be used to access the resource.", - nullable=True, - ) - _element.actions = AAZListArg( - options=["actions"], - help="Describes the actions permitted to the service upon delegation", - nullable=True, - ) - _element.service_name = AAZStrArg( - options=["service-name"], - help="The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers)", - nullable=True, - ) - - actions = cls._args_subnet_update.delegations.Element.actions - actions.Element = AAZStrArg( - nullable=True, - ) - - resource_navigation_links = cls._args_subnet_update.resource_navigation_links - resource_navigation_links.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.resource_navigation_links.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.link = AAZStrArg( - options=["link"], - help="Link to the external resource", - nullable=True, - ) - _element.linked_resource_type = AAZStrArg( - options=["linked-resource-type"], - help="Resource type of the linked resource.", - nullable=True, - ) - - route_table = cls._args_subnet_update.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.disable_bgp_route_propagation = AAZBoolArg( - options=["disable-bgp-route-propagation"], - help="Gets or sets whether to disable the routes learned by BGP on that route table. True means disable.", - nullable=True, - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - nullable=True, - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - routes = cls._args_subnet_update.route_table.routes - routes.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - nullable=True, - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - nullable=True, - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - - tags = cls._args_subnet_update.route_table.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - service_association_links = cls._args_subnet_update.service_association_links - service_association_links.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.service_association_links.Element - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="Name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.link = AAZStrArg( - options=["link"], - help="Link to the external resource.", - nullable=True, - ) - _element.linked_resource_type = AAZStrArg( - options=["linked-resource-type"], - help="Resource type of the linked resource.", - nullable=True, - ) - - service_endpoint_policies = cls._args_subnet_update.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.service_endpoint_policies.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.service_endpoint_policy_definitions = AAZListArg( - options=["service-endpoint-policy-definitions"], - help="A collection of service endpoint policy definitions of the service endpoint policy.", - nullable=True, - ) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - service_endpoint_policy_definitions = cls._args_subnet_update.service_endpoint_policies.Element.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.service_endpoint_policies.Element.service_endpoint_policy_definitions.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}/serviceEndpointPolicyDefinitions/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.service = AAZStrArg( - options=["service"], - help="service endpoint name.", - nullable=True, - ) - _element.service_resources = AAZListArg( - options=["service-resources"], - help="A list of service resources.", - nullable=True, - ) - - service_resources = cls._args_subnet_update.service_endpoint_policies.Element.service_endpoint_policy_definitions.Element.service_resources - service_resources.Element = AAZStrArg( - nullable=True, - ) - - tags = cls._args_subnet_update.service_endpoint_policies.Element.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - service_endpoints = cls._args_subnet_update.service_endpoints - service_endpoints.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_subnet_update.service_endpoints.Element - _element.locations = AAZListArg( - options=["locations"], - help="A list of locations.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - nullable=True, - ) - _element.service = AAZStrArg( - options=["service"], - help="The type of the endpoint service.", - nullable=True, - ) - - locations = cls._args_subnet_update.service_endpoints.Element.locations - locations.Element = AAZStrArg( - nullable=True, - ) - - _schema.address_prefix = cls._args_subnet_update.address_prefix - _schema.address_prefixes = cls._args_subnet_update.address_prefixes - _schema.delegations = cls._args_subnet_update.delegations - _schema.id = cls._args_subnet_update.id - _schema.name = cls._args_subnet_update.name - _schema.network_security_group = cls._args_subnet_update.network_security_group - _schema.resource_navigation_links = cls._args_subnet_update.resource_navigation_links - _schema.route_table = cls._args_subnet_update.route_table - _schema.service_association_links = cls._args_subnet_update.service_association_links - _schema.service_endpoint_policies = cls._args_subnet_update.service_endpoint_policies - _schema.service_endpoints = cls._args_subnet_update.service_endpoints - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.selectors.subresource.required()) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.selectors.subresource.required()) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.selectors.subresource.required()) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("applicationGatewayBackendAddressPools", AAZListType, ".application_gateway_backend_address_pools") - properties.set_prop("applicationSecurityGroups", AAZListType, ".asgs_obj") - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".make_primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAddressVersion", AAZStrType, ".private_ip_address_version") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType) - properties.set_prop("subnet", AAZObjectType) - - application_gateway_backend_address_pools = _builder.get(".properties.applicationGatewayBackendAddressPools") - if application_gateway_backend_address_pools is not None: - application_gateway_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationGatewayBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - application_security_groups = _builder.get(".properties.applicationSecurityGroups") - if application_security_groups is not None: - application_security_groups.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationSecurityGroups[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".properties.applicationSecurityGroups[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - public_ip_address = _builder.get(".properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".public_ip_address") - public_ip_address.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - subnet = _builder.get(".properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - subnet.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.selectors.subresource.required(), - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_interface_ip_configuration_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("applicationGatewayBackendAddressPools", AAZListType, ".application_gateway_backend_address_pools") - properties.set_prop("applicationSecurityGroups", AAZListType, ".application_security_groups") - properties.set_prop("loadBalancerBackendAddressPools", AAZListType, ".load_balancer_backend_address_pools") - properties.set_prop("loadBalancerInboundNatRules", AAZListType, ".load_balancer_inbound_nat_rules") - properties.set_prop("primary", AAZBoolType, ".primary") - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAddressVersion", AAZStrType, ".private_ip_address_version") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - properties.set_prop("virtualNetworkTaps", AAZListType, ".virtual_network_taps") - - application_gateway_backend_address_pools = _builder.get(".properties.applicationGatewayBackendAddressPools") - if application_gateway_backend_address_pools is not None: - application_gateway_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationGatewayBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("type", AAZStrType, ".type") - - properties = _builder.get(".properties.applicationGatewayBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("backendAddresses", AAZListType, ".backend_addresses") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - backend_addresses = _builder.get(".properties.applicationGatewayBackendAddressPools[].properties.backendAddresses") - if backend_addresses is not None: - backend_addresses.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.applicationGatewayBackendAddressPools[].properties.backendAddresses[]") - if _elements is not None: - _elements.set_prop("fqdn", AAZStrType, ".fqdn") - _elements.set_prop("ipAddress", AAZStrType, ".ip_address") - - application_security_groups = _builder.get(".properties.applicationSecurityGroups") - if application_security_groups is not None: - cls._build_schema_application_security_group_update(application_security_groups.set_elements(AAZObjectType, ".")) - - load_balancer_backend_address_pools = _builder.get(".properties.loadBalancerBackendAddressPools") - if load_balancer_backend_address_pools is not None: - load_balancer_backend_address_pools.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerBackendAddressPools[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerBackendAddressPools[].properties") - if properties is not None: - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - load_balancer_inbound_nat_rules = _builder.get(".properties.loadBalancerInboundNatRules") - if load_balancer_inbound_nat_rules is not None: - load_balancer_inbound_nat_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.loadBalancerInboundNatRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.loadBalancerInboundNatRules[].properties") - if properties is not None: - properties.set_prop("backendPort", AAZIntType, ".backend_port") - properties.set_prop("enableFloatingIP", AAZBoolType, ".enable_floating_ip") - properties.set_prop("enableTcpReset", AAZBoolType, ".enable_tcp_reset") - cls._build_schema_sub_resource_update(properties.set_prop("frontendIPConfiguration", AAZObjectType, ".frontend_ip_configuration")) - properties.set_prop("frontendPort", AAZIntType, ".frontend_port") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("protocol", AAZStrType, ".protocol") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - virtual_network_taps = _builder.get(".properties.virtualNetworkTaps") - if virtual_network_taps is not None: - virtual_network_taps.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.virtualNetworkTaps[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.virtualNetworkTaps[].properties") - if properties is not None: - properties.set_prop("destinationLoadBalancerFrontEndIPConfiguration", AAZObjectType, ".destination_load_balancer_front_end_ip_configuration") - cls._build_schema_network_interface_ip_configuration_update(properties.set_prop("destinationNetworkInterfaceIPConfiguration", AAZObjectType, ".destination_network_interface_ip_configuration")) - properties.set_prop("destinationPort", AAZIntType, ".destination_port") - - destination_load_balancer_front_end_ip_configuration = _builder.get(".properties.virtualNetworkTaps[].properties.destinationLoadBalancerFrontEndIPConfiguration") - if destination_load_balancer_front_end_ip_configuration is not None: - destination_load_balancer_front_end_ip_configuration.set_prop("etag", AAZStrType, ".etag") - destination_load_balancer_front_end_ip_configuration.set_prop("id", AAZStrType, ".id") - destination_load_balancer_front_end_ip_configuration.set_prop("name", AAZStrType, ".name") - destination_load_balancer_front_end_ip_configuration.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - destination_load_balancer_front_end_ip_configuration.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties.virtualNetworkTaps[].properties.destinationLoadBalancerFrontEndIPConfiguration.properties") - if properties is not None: - properties.set_prop("privateIPAddress", AAZStrType, ".private_ip_address") - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - cls._build_schema_public_ip_address_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_sub_resource_update(properties.set_prop("publicIPPrefix", AAZObjectType, ".public_ip_prefix")) - cls._build_schema_subnet_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - zones = _builder.get(".properties.virtualNetworkTaps[].properties.destinationLoadBalancerFrontEndIPConfiguration.zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.virtualNetworkTaps[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_network_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - - default_security_rules = _builder.get(".properties.defaultSecurityRules") - if default_security_rules is not None: - cls._build_schema_security_rule_update(default_security_rules.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.securityRules[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.securityRules[].properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.securityRules[].properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.securityRules[].properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.securityRules[].properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.securityRules[].properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.securityRules[].properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_public_ip_address_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("sku", AAZObjectType, ".sku") - _builder.set_prop("tags", AAZDictType, ".tags") - _builder.set_prop("zones", AAZListType, ".zones") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("ddosSettings", AAZObjectType, ".ddos_settings") - properties.set_prop("dnsSettings", AAZObjectType, ".dns_settings") - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout_in_minutes") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("ipTags", AAZListType, ".ip_tags") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("publicIPAddressVersion", AAZStrType, ".public_ip_address_version") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".public_ip_allocation_method") - cls._build_schema_sub_resource_update(properties.set_prop("publicIPPrefix", AAZObjectType, ".public_ip_prefix")) - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - - ddos_settings = _builder.get(".properties.ddosSettings") - if ddos_settings is not None: - cls._build_schema_sub_resource_update(ddos_settings.set_prop("ddosCustomPolicy", AAZObjectType, ".ddos_custom_policy")) - ddos_settings.set_prop("protectionCoverage", AAZStrType, ".protection_coverage") - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".domain_name_label") - dns_settings.set_prop("fqdn", AAZStrType, ".fqdn") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - ip_tags = _builder.get(".properties.ipTags") - if ip_tags is not None: - ip_tags.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipTags[]") - if _elements is not None: - _elements.set_prop("ipTagType", AAZStrType, ".ip_tag_type") - _elements.set_prop("tag", AAZStrType, ".tag") - - sku = _builder.get(".sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".name") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - zones = _builder.get(".zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_subnet_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - properties.set_prop("delegations", AAZListType, ".delegations") - cls._build_schema_network_security_group_update(properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group")) - properties.set_prop("resourceNavigationLinks", AAZListType, ".resource_navigation_links") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - properties.set_prop("serviceAssociationLinks", AAZListType, ".service_association_links") - properties.set_prop("serviceEndpointPolicies", AAZListType, ".service_endpoint_policies") - properties.set_prop("serviceEndpoints", AAZListType, ".service_endpoints") - - address_prefixes = _builder.get(".properties.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - delegations = _builder.get(".properties.delegations") - if delegations is not None: - delegations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.delegations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.delegations[].properties") - if properties is not None: - properties.set_prop("actions", AAZListType, ".actions") - properties.set_prop("serviceName", AAZStrType, ".service_name") - - actions = _builder.get(".properties.delegations[].properties.actions") - if actions is not None: - actions.set_elements(AAZStrType, ".") - - resource_navigation_links = _builder.get(".properties.resourceNavigationLinks") - if resource_navigation_links is not None: - resource_navigation_links.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.resourceNavigationLinks[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.resourceNavigationLinks[].properties") - if properties is not None: - properties.set_prop("link", AAZStrType, ".link") - properties.set_prop("linkedResourceType", AAZStrType, ".linked_resource_type") - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.routeTable.properties") - if properties is not None: - properties.set_prop("disableBgpRoutePropagation", AAZBoolType, ".disable_bgp_route_propagation") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - - routes = _builder.get(".properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - tags = _builder.get(".properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - service_association_links = _builder.get(".properties.serviceAssociationLinks") - if service_association_links is not None: - service_association_links.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceAssociationLinks[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.serviceAssociationLinks[].properties") - if properties is not None: - properties.set_prop("link", AAZStrType, ".link") - properties.set_prop("linkedResourceType", AAZStrType, ".linked_resource_type") - - service_endpoint_policies = _builder.get(".properties.serviceEndpointPolicies") - if service_endpoint_policies is not None: - service_endpoint_policies.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpointPolicies[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.serviceEndpointPolicies[].properties") - if properties is not None: - properties.set_prop("serviceEndpointPolicyDefinitions", AAZListType, ".service_endpoint_policy_definitions") - - service_endpoint_policy_definitions = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions") - if service_endpoint_policy_definitions is not None: - service_endpoint_policy_definitions.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties") - if properties is not None: - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("service", AAZStrType, ".service") - properties.set_prop("serviceResources", AAZListType, ".service_resources") - - service_resources = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties.serviceResources") - if service_resources is not None: - service_resources.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.serviceEndpointPolicies[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - service_endpoints = _builder.get(".properties.serviceEndpoints") - if service_endpoints is not None: - service_endpoints.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpoints[]") - if _elements is not None: - _elements.set_prop("locations", AAZListType, ".locations") - _elements.set_prop("provisioningState", AAZStrType, ".provisioning_state") - _elements.set_prop("service", AAZStrType, ".service") - - locations = _builder.get(".properties.serviceEndpoints[].locations") - if locations is not None: - locations.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_wait.py deleted file mode 100644 index 82f0a0d7f37..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/_wait.py +++ /dev/null @@ -1,1428 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01", "properties.ipConfigurations[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/ag_pool/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/ag_pool/__cmd_group.py deleted file mode 100644 index 265bf5a2e1b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/ag_pool/__cmd_group.py +++ /dev/null @@ -1,20 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class __CMDGroup(AAZCommandGroup): - """Manage address pools in an IP configuration. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/ag_pool/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/ag_pool/__init__.py deleted file mode 100644 index 0b07bb6fd96..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/ag_pool/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._add import * -from ._remove import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/ag_pool/_add.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/ag_pool/_add.py deleted file mode 100644 index 6f34af8e0df..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/ag_pool/_add.py +++ /dev/null @@ -1,1618 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Add(AAZCommand): - """Add an address pool to an IP configuration. - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01", "properties.ipConfigurations[].properties.applicationGatewayBackendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.pool_id = AAZStrArg( - options=["--pool-id"], - help="Resource ID.", - required=True, - ) - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.applicationGatewayBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.applicationGatewayBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("id", AAZStrType, ".pool_id") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - -class _AddHelper: - """Helper class for Add""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Add"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/ag_pool/_remove.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/ag_pool/_remove.py deleted file mode 100644 index d642b32343a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/ag_pool/_remove.py +++ /dev/null @@ -1,1602 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Remove(AAZCommand): - """Remove an address pool of an IP configuration. - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01", "properties.ipConfigurations[].properties.applicationGatewayBackendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.pool_id = AAZStrArg( - options=["--pool-id"], - help="Resource ID.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.applicationGatewayBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.applicationGatewayBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _RemoveHelper: - """Helper class for Remove""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Remove"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/inbound_nat_rule/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/inbound_nat_rule/__cmd_group.py deleted file mode 100644 index 0ad92b74449..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/inbound_nat_rule/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 nic ip-config inbound-nat-rule", -) -class __CMDGroup(AAZCommandGroup): - """Manage inbound NAT rules of an IP configuration. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/inbound_nat_rule/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/inbound_nat_rule/__init__.py deleted file mode 100644 index 7767ee77098..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/inbound_nat_rule/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._add import * -from ._remove import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/inbound_nat_rule/_add.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/inbound_nat_rule/_add.py deleted file mode 100644 index a7283e9abd2..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/inbound_nat_rule/_add.py +++ /dev/null @@ -1,1653 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config inbound-nat-rule add", -) -class Add(AAZCommand): - """Add an inbound NAT rule to an IP configuration. - - :example: Add an inbound NAT rule to an IP configuration. - az network nic ip-config inbound-nat-rule add -g MyResourceGroup --nic-name MyNic -n MyIpConfig --inbound-nat-rule MyNatRule - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01", "properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.inbound_nat_rule = AAZResourceIdArg( - options=["--inbound-nat-rule"], - help="Name or ID of an existing inbound NAT rule. If name is used, `--lb-name` must be specified.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - - # define Arg Group "Parameters.properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]" - - # define Arg Group "Properties" - return cls._args_schema - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg() - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - - _schema.id = cls._args_sub_resource_update.id - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerInboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.inbound_nat_rule, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerInboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.inbound_nat_rule, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("id", AAZStrType, ".inbound_nat_rule") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - -class _AddHelper: - """Helper class for Add""" - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Add"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/inbound_nat_rule/_remove.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/inbound_nat_rule/_remove.py deleted file mode 100644 index 79419c0fcea..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/inbound_nat_rule/_remove.py +++ /dev/null @@ -1,1611 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config inbound-nat-rule remove", -) -class Remove(AAZCommand): - """Remove an inbound NAT rule of an IP configuration. - - :example: Remove an inbound NAT rule of an IP configuration. - az network nic ip-config inbound-nat-rule remove -g MyResourceGroup --nic-name MyNic -n MyIpConfig --inbound-nat-rule MyNatRule - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01", "properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.inbound_nat_rule = AAZResourceIdArg( - options=["--inbound-nat-rule"], - help="Resource ID.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/inboundNatRules/{}", - ), - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerInboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.inbound_nat_rule, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerInboundNatRules - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.inbound_nat_rule, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _RemoveHelper: - """Helper class for Remove""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Remove"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/inbound_nat_rule/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/inbound_nat_rule/_wait.py deleted file mode 100644 index 62e61145f5e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/inbound_nat_rule/_wait.py +++ /dev/null @@ -1,1428 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nic ip-config inbound-nat-rule wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01", "properties.ipConfigurations[].properties.loadBalancerInboundNatRules[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/lb_pool/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/lb_pool/__cmd_group.py deleted file mode 100644 index 265bf5a2e1b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/lb_pool/__cmd_group.py +++ /dev/null @@ -1,20 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class __CMDGroup(AAZCommandGroup): - """Manage address pools in an IP configuration. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/lb_pool/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/lb_pool/__init__.py deleted file mode 100644 index 0b07bb6fd96..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/lb_pool/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._add import * -from ._remove import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/lb_pool/_add.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/lb_pool/_add.py deleted file mode 100644 index a1ecd159f03..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/lb_pool/_add.py +++ /dev/null @@ -1,1623 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Add(AAZCommand): - """Add an address pool to an IP configuration. - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01", "properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.pool_id = AAZResourceIdArg( - options=["--pool-id"], - help="Resource ID.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}", - ), - ) - - # define Arg Group "Parameters.properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]" - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _AddHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("id", AAZStrType, ".pool_id") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - return _instance_value - - -class _AddHelper: - """Helper class for Add""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Add"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/lb_pool/_remove.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/lb_pool/_remove.py deleted file mode 100644 index 3ae8381f9c2..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nic/ip_config/lb_pool/_remove.py +++ /dev/null @@ -1,1605 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Remove(AAZCommand): - """Remove an address pool of an IP configuration. - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networkinterfaces/{}", "2018-11-01", "properties.ipConfigurations[].properties.loadBalancerBackendAddressPools[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nic_name = AAZStrArg( - options=["--nic-name"], - help="Name of the network interface (NIC).", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.ip_config_name = AAZStrArg( - options=["-n", "--ip-config-name"], - help="Name of the IP configuration.", - required=True, - ) - _args_schema.pool_id = AAZResourceIdArg( - options=["--pool-id"], - help="Resource ID.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/loadBalancers/{}/backendAddressPools/{}", - ), - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkInterfacesGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.NetworkInterfacesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipConfigurations - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.ip_config_name, - filters - ) - idx = next(filters)[0] - result = result[idx] - result = result.properties.loadBalancerBackendAddressPools - filters = enumerate(result) - filters = filter( - lambda e: e[1].id == self.ctx.args.pool_id, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class NetworkInterfacesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkInterfacesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkInterfaceName", self.ctx.args.nic_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _RemoveHelper._build_schema_network_interface_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _RemoveHelper: - """Helper class for Remove""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Remove"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/__cmd_group.py deleted file mode 100644 index 581b4fd303c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 nsg", -) -class __CMDGroup(AAZCommandGroup): - """Manage Azure Network Security Groups (NSGs). - - You can control network traffic to resources in a virtual network using a network security group. A network security group contains a list of security rules that allow or deny inbound or outbound network traffic based on source or destination IP addresses, Application Security Groups, ports, and protocols. For more information visit https://learn.microsoft.com/azure/virtual-network/virtual-networks-create-nsg-arm-cli. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_create.py deleted file mode 100644 index 673e3efaef6..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_create.py +++ /dev/null @@ -1,1729 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg create", -) -class Create(AAZCommand): - """Create a network security group. - - :example: Create an NSG in a resource group within a region with tags. - az network nsg create -g MyResourceGroup -n MyNsg --tags foo=bar - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - return cls._args_schema - - _args_application_security_group_create = None - - @classmethod - def _build_args_application_security_group_create(cls, _schema): - if cls._args_application_security_group_create is not None: - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - return - - cls._args_application_security_group_create = AAZObjectArg() - - application_security_group_create = cls._args_application_security_group_create - application_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - security_rule_create.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - security_rule_create.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_create.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.etag = cls._args_security_rule_create.etag - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkSecurityGroupsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkSecurityGroupsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_network_security_group_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_application_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_delete.py deleted file mode 100644 index 740f7d30f07..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg delete", -) -class Delete(AAZCommand): - """Delete a network security group. - - :example: Delete an NSG in a resource group. - az network nsg delete -g MyResourceGroup -n MyNsg - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.NetworkSecurityGroupsDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class NetworkSecurityGroupsDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_list.py deleted file mode 100644 index c80a1264a1a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_list.py +++ /dev/null @@ -1,1518 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg list", -) -class List(AAZCommand): - """List network security groups. - - :example: List all NSGs in the 'westus' region. - az network nsg list --query "[?location=='westus']" - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/networksecuritygroups", "2018-11-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.NetworkSecurityGroupsList(ctx=self.ctx)() - if condition_1: - self.NetworkSecurityGroupsListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class NetworkSecurityGroupsList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_network_security_group_read(value.Element) - - return cls._schema_on_200 - - class NetworkSecurityGroupsListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_network_security_group_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_show.py deleted file mode 100644 index 1f04cacf050..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_show.py +++ /dev/null @@ -1,1444 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg show", -) -class Show(AAZCommand): - """Get information about a network security group. - - :example: Get basic information about an NSG. - az network nsg show -g MyResourceGroup -n MyNsg - - :example: Get the default security rules of an NSG and format the output as a table. - az network nsg show -g MyResourceGroup -n MyNsg --query "defaultSecurityRules[]" -o table - - :example: Get all default NSG rules with "Allow" access and format the output as a table. - az network nsg show -g MyResourceGroup -n MyNsg --query "defaultSecurityRules[?access=='Allow']" -o table - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkSecurityGroupsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkSecurityGroupsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_network_security_group_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_update.py deleted file mode 100644 index ffc38f0b262..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_update.py +++ /dev/null @@ -1,1886 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg update", -) -class Update(AAZCommand): - """Update a network security group. - - This command can only be used to update the tags of an NSG. Name and resource group are immutable and cannot be updated. - - :example: Remove a tag of an NSG. - az network nsg update -g MyResourceGroup -n MyNsg --remove tags.no_80 - - :example: Update a network security group. (autogenerated) - az network nsg update --name MyNsg --resource-group MyResourceGroup --set tags.CostCenter=MyBusinessGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.etag = cls._args_security_rule_update.etag - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - def _execute_operations(self): - self.pre_operations() - self.NetworkSecurityGroupsGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.NetworkSecurityGroupsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class NetworkSecurityGroupsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_network_security_group_read(cls._schema_on_200) - - return cls._schema_on_200 - - class NetworkSecurityGroupsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_network_security_group_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_wait.py deleted file mode 100644 index e5a81941b07..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/_wait.py +++ /dev/null @@ -1,1434 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.NetworkSecurityGroupsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class NetworkSecurityGroupsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_network_security_group_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/__cmd_group.py deleted file mode 100644 index cf73713d97d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 nsg rule", -) -class __CMDGroup(AAZCommandGroup): - """Manage network security group rules. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_create.py deleted file mode 100644 index 22c83920227..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_create.py +++ /dev/null @@ -1,544 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule create", -) -class Create(AAZCommand): - """Create a network security group rule. - - :example: Create a basic "Allow" NSG rule with the highest priority. - az network nsg rule create -g MyResourceGroup --nsg-name MyNsg -n MyNsgRule --priority 100 - - :example: Create a "Deny" rule over TCP for a specific IP address range with the lowest priority. - az network nsg rule create -g MyResourceGroup --nsg-name MyNsg -n MyNsgRule --priority 4096 --source-address-prefixes 208.130.28.0/24 --source-port-ranges 80 --destination-address-prefixes '*' --destination-port-ranges 80 8080 --access Deny --protocol Tcp --description "Deny from specific IP address ranges on 80 and 8080." - - :example: Create a security rule using service tags (https://aka.ms/servicetags). - az network nsg rule create -g MyResourceGroup --nsg-name MyNsg -n MyNsgRuleWithTags --priority 400 --source-address-prefixes VirtualNetwork --destination-address-prefixes Storage --destination-port-ranges '*' --direction Outbound --access Allow --protocol Tcp --description "Allow VirtualNetwork to Storage." - - :example: Create a security rule using application security groups (https://aka.ms/applicationsecuritygroups). - az network nsg rule create -g MyResourceGroup --nsg-name MyNsg -n MyNsgRuleWithAsg --priority 500 --source-address-prefixes Internet --destination-port-ranges 80 8080 --destination-asgs Web --access Allow --protocol Tcp --description "Allow Internet to Web ASG on ports 80,8080." - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group rule.", - required=True, - ) - _args_schema.access = AAZStrArg( - options=["--access"], - help="Network traffic is allowed or denied.", - default="Allow", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _args_schema.description = AAZStrArg( - options=["--description"], - help="Description for this rule. Restricted to 140 chars.", - ) - _args_schema.direction = AAZStrArg( - options=["--direction"], - help="Direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", - default="Inbound", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _args_schema.priority = AAZIntArg( - options=["--priority"], - help="Priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - help="Network protocol this rule applies to.", - default="*", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - # define Arg Group "Destination" - - _args_schema = cls._args_schema - _args_schema.destination_address_prefix = AAZStrArg( - options=["--destination-address-prefix"], - arg_group="Destination", - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _args_schema.destination_address_prefixes = AAZListArg( - options=["--destination-address-prefixes"], - arg_group="Destination", - help="Space-separated list of CIDR prefixes or IP ranges. Alternatively, specify ONE of 'VirtualNetwork', 'AzureLoadBalancer', 'Internet' or '*' to match all IPs. Besides, it also supports all available Service Tags like 'ApiManagement', 'SqlManagement', 'AzureMonitor', etc.", - default=["*"], - ) - _args_schema.destination_application_security_groups = AAZListArg( - options=["--destination-application-security-groups"], - arg_group="Destination", - help="Application security group specified as destination.", - ) - _args_schema.destination_port_range = AAZStrArg( - options=["--destination-port-range"], - arg_group="Destination", - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _args_schema.destination_port_ranges = AAZListArg( - options=["--destination-port-ranges"], - arg_group="Destination", - help="Space-separated list of ports or port ranges between 0-65535. Use '*' to match all ports.", - default=["80"], - ) - - destination_address_prefixes = cls._args_schema.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_schema.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_schema.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - # define Arg Group "Properties" - - # define Arg Group "SecurityRuleParameters" - - # define Arg Group "Source" - - _args_schema = cls._args_schema - _args_schema.source_address_prefix = AAZStrArg( - options=["--source-address-prefix"], - arg_group="Source", - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.", - ) - _args_schema.source_address_prefixes = AAZListArg( - options=["--source-address-prefixes"], - arg_group="Source", - help="Space-separated list of CIDR prefixes or IP ranges. Alternatively, specify ONE of 'VirtualNetwork', 'AzureLoadBalancer', 'Internet' or '*' to match all IPs. Besides, it also supports all available Service Tags like 'ApiManagement', 'SqlManagement', 'AzureMonitor', etc.", - default=["*"], - ) - _args_schema.source_application_security_groups = AAZListArg( - options=["--source-application-security-groups"], - arg_group="Source", - help="Application security group specified as source.", - ) - _args_schema.source_port_range = AAZStrArg( - options=["--source-port-range"], - arg_group="Source", - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _args_schema.source_port_ranges = AAZListArg( - options=["--source-port-ranges"], - arg_group="Source", - help="Space-separated list of ports or port ranges between 0-65535. Use '*' to match all ports.", - default=["*"], - ) - - source_address_prefixes = cls._args_schema.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_schema.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_schema.source_port_ranges - source_port_ranges.Element = AAZStrArg() - return cls._args_schema - - _args_application_security_group_create = None - - @classmethod - def _build_args_application_security_group_create(cls, _schema): - if cls._args_application_security_group_create is not None: - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - return - - cls._args_application_security_group_create = AAZObjectArg() - - application_security_group_create = cls._args_application_security_group_create - application_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - - def _execute_operations(self): - self.pre_operations() - yield self.SecurityRulesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SecurityRulesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - _CreateHelper._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - _CreateHelper._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.name = AAZStrType() - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = cls._schema_on_200_201.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = cls._schema_on_200_201.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - _CreateHelper._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = cls._schema_on_200_201.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = cls._schema_on_200_201.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = cls._schema_on_200_201.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - _CreateHelper._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = cls._schema_on_200_201.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_application_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_delete.py deleted file mode 100644 index f8aa41908c2..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_delete.py +++ /dev/null @@ -1,172 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule delete", -) -class Delete(AAZCommand): - """Delete a network security group rule. - - :example: Delete a network security group rule. - az network nsg rule delete -g MyResourceGroup --nsg-name MyNsg -n MyNsgRule - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group rule.", - required=True, - id_part="child_name_1", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.SecurityRulesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class SecurityRulesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_list.py deleted file mode 100644 index 9e074437fe4..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_list.py +++ /dev/null @@ -1,298 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule list", -) -class List(AAZCommand): - """List all rules in a network security group. - - :example: List all rules in a network security group. - az network nsg rule list -g MyResourceGroup --nsg-name MyNsg - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SecurityRulesList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class SecurityRulesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = cls._schema_on_200.value.Element.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = cls._schema_on_200.value.Element.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - _ListHelper._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = cls._schema_on_200.value.Element.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = cls._schema_on_200.value.Element.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = cls._schema_on_200.value.Element.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - _ListHelper._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = cls._schema_on_200.value.Element.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_show.py deleted file mode 100644 index 06252081c0a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_show.py +++ /dev/null @@ -1,300 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule show", -) -class Show(AAZCommand): - """Get the details of a network security group rule. - - :example: Get the details of a network security group rule. - az network nsg rule show -g MyResourceGroup --nsg-name MyNsg -n MyNsgRule - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group rule.", - required=True, - id_part="child_name_1", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SecurityRulesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SecurityRulesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = cls._schema_on_200.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = cls._schema_on_200.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - _ShowHelper._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = cls._schema_on_200.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = cls._schema_on_200.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = cls._schema_on_200.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - _ShowHelper._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = cls._schema_on_200.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_update.py deleted file mode 100644 index 6c119a63eab..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_update.py +++ /dev/null @@ -1,706 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule update", -) -class Update(AAZCommand): - """Update a network security group rule. - - :example: Update an NSG rule with a new wildcard destination address prefix. - az network nsg rule update -g MyResourceGroup --nsg-name MyNsg -n MyNsgRule --destination-address-prefix '*' - - :example: Update a network security group rule. - az network nsg rule update --name MyNsgRule --nsg-name MyNsg --resource-group MyResourceGroup --source-address-prefixes 208.130.28/24 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group rule.", - required=True, - id_part="child_name_1", - ) - _args_schema.access = AAZStrArg( - options=["--access"], - help="Network traffic is allowed or denied.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _args_schema.description = AAZStrArg( - options=["--description"], - help="Description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _args_schema.direction = AAZStrArg( - options=["--direction"], - help="Direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _args_schema.priority = AAZIntArg( - options=["--priority"], - help="Priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - _args_schema.protocol = AAZStrArg( - options=["--protocol"], - help="Network protocol this rule applies to.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - - # define Arg Group "Destination" - - _args_schema = cls._args_schema - _args_schema.destination_address_prefix = AAZStrArg( - options=["--destination-address-prefix"], - arg_group="Destination", - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - _args_schema.destination_address_prefixes = AAZListArg( - options=["--destination-address-prefixes"], - arg_group="Destination", - help="Space-separated list of CIDR prefixes or IP ranges. Alternatively, specify ONE of 'VirtualNetwork', 'AzureLoadBalancer', 'Internet' or '*' to match all IPs. Besides, it also supports all available Service Tags like 'ApiManagement', 'SqlManagement', 'AzureMonitor', etc.", - nullable=True, - ) - _args_schema.destination_application_security_groups = AAZListArg( - options=["--destination-application-security-groups"], - arg_group="Destination", - help="Application security group specified as destination.", - nullable=True, - ) - _args_schema.destination_port_range = AAZStrArg( - options=["--destination-port-range"], - arg_group="Destination", - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _args_schema.destination_port_ranges = AAZListArg( - options=["--destination-port-ranges"], - arg_group="Destination", - help="Space-separated list of ports or port ranges between 0-65535. Use '*' to match all ports.", - nullable=True, - ) - - destination_address_prefixes = cls._args_schema.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_schema.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_schema.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Properties" - - # define Arg Group "SecurityRuleParameters" - - # define Arg Group "Source" - - _args_schema = cls._args_schema - _args_schema.source_address_prefix = AAZStrArg( - options=["--source-address-prefix"], - arg_group="Source", - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.", - nullable=True, - ) - _args_schema.source_address_prefixes = AAZListArg( - options=["--source-address-prefixes"], - arg_group="Source", - help="Space-separated list of CIDR prefixes or IP ranges. Alternatively, specify ONE of 'VirtualNetwork', 'AzureLoadBalancer', 'Internet' or '*' to match all IPs. Besides, it also supports all available Service Tags like 'ApiManagement', 'SqlManagement', 'AzureMonitor', etc.", - nullable=True, - ) - _args_schema.source_application_security_groups = AAZListArg( - options=["--source-application-security-groups"], - arg_group="Source", - help="Application security group specified as source.", - nullable=True, - ) - _args_schema.source_port_range = AAZStrArg( - options=["--source-port-range"], - arg_group="Source", - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - nullable=True, - ) - _args_schema.source_port_ranges = AAZListArg( - options=["--source-port-ranges"], - arg_group="Source", - help="Space-separated list of ports or port ranges between 0-65535. Use '*' to match all ports.", - nullable=True, - ) - - source_address_prefixes = cls._args_schema.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_schema.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_schema.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - def _execute_operations(self): - self.pre_operations() - self.SecurityRulesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.SecurityRulesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SecurityRulesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_security_rule_read(cls._schema_on_200) - - return cls._schema_on_200 - - class SecurityRulesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_security_rule_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - _UpdateHelper._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - _UpdateHelper._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_wait.py deleted file mode 100644 index 4bb9a35cfaf..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/nsg/rule/_wait.py +++ /dev/null @@ -1,296 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network nsg rule wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/networksecuritygroups/{}/securityrules/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.nsg_name = AAZStrArg( - options=["--nsg-name"], - help="Name of the network security group.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the network security group rule.", - required=True, - id_part="child_name_1", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SecurityRulesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class SecurityRulesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "networkSecurityGroupName", self.ctx.args.nsg_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "securityRuleName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = cls._schema_on_200.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = cls._schema_on_200.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - _WaitHelper._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = cls._schema_on_200.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = cls._schema_on_200.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = cls._schema_on_200.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - _WaitHelper._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = cls._schema_on_200.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/__cmd_group.py deleted file mode 100644 index 07c867f7590..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 public-ip", -) -class __CMDGroup(AAZCommandGroup): - """Manage public IP addresses. - - To learn more about public IP addresses visit https://learn.microsoft.com/azure/virtual-network/virtual-network-public-ip-address. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_create.py deleted file mode 100644 index 205591996d8..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_create.py +++ /dev/null @@ -1,1591 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Create(AAZCommand): - """Create a public IP address. - - :example: Create a basic public IP resource. - az network public-ip create -g MyResourceGroup -n MyIp - - :example: Create a static public IP resource for a DNS name label. - az network public-ip create -g MyResourceGroup -n MyIp --dns-name MyLabel --allocation-method Static - - :example: Create a public IP resource in an availability zone in the current resource group region. - az network public-ip create -g MyResourceGroup -n MyIp --zone 2 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP address.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.dns_name = AAZStrArg( - options=["--dns-name"], - help="Globally unique DNS entry.", - ) - _args_schema.reverse_fqdn = AAZStrArg( - options=["--reverse-fqdn"], - help="Reverse FQDN (fully qualified domain name).", - ) - _args_schema.idle_timeout = AAZIntArg( - options=["--idle-timeout"], - help="Idle timeout in minutes.", - default=4, - ) - _args_schema.ip_address = AAZStrArg( - options=["--ip-address"], - help="The IP address associated with the public IP address resource.", - ) - _args_schema.ip_tags = AAZListArg( - options=["--ip-tags"], - help="Space-separated list of IP tags in 'TYPE=VAL' format.", - ) - _args_schema.version = AAZStrArg( - options=["--version"], - help="IP address type.", - default="IPv4", - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - _args_schema.allocation_method = AAZStrArg( - options=["--allocation-method"], - help="IP address allocation method.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _args_schema.public_ip_prefix = AAZStrArg( - options=["--public-ip-prefix"], - help="Name or ID of a public IP prefix.", - ) - _args_schema.sku = AAZStrArg( - options=["--sku"], - help="Name of a public IP address SKU.", - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - _args_schema.zone = AAZListArg( - options=["-z", "--zone"], - help="Space-separated list of availability zones into which to provision the resource. Allowed values: 1, 2, 3.", - ) - - ip_tags = cls._args_schema.ip_tags - ip_tags.Element = AAZObjectArg() - - _element = cls._args_schema.ip_tags.Element - _element.ip_tag_type = AAZStrArg( - options=["ip-tag-type"], - help="The IP tag type. Example: FirstPartyUsage.", - ) - _element.tag = AAZStrArg( - options=["tag"], - help="The value of the IP tag associated with the public IP. Example: SQL.", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - zone = cls._args_schema.zone - zone.Element = AAZStrArg() - - # define Arg Group "DdosSettings" - - # define Arg Group "DnsSettings" - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.PublicIPAddressesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class PublicIPAddressesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("sku", AAZObjectType) - _builder.set_prop("tags", AAZDictType, ".tags") - _builder.set_prop("zones", AAZListType, ".zone") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("ddosSettings", AAZObjectType) - properties.set_prop("dnsSettings", AAZObjectType) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout") - properties.set_prop("ipAddress", AAZStrType, ".ip_address") - properties.set_prop("ipTags", AAZListType, ".ip_tags") - properties.set_prop("publicIPAddressVersion", AAZStrType, ".version") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".allocation_method") - properties.set_prop("publicIPPrefix", AAZObjectType) - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".dns_name") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - ip_tags = _builder.get(".properties.ipTags") - if ip_tags is not None: - ip_tags.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipTags[]") - if _elements is not None: - _elements.set_prop("ipTagType", AAZStrType, ".ip_tag_type") - _elements.set_prop("tag", AAZStrType, ".tag") - - public_ip_prefix = _builder.get(".properties.publicIPPrefix") - if public_ip_prefix is not None: - public_ip_prefix.set_prop("id", AAZStrType, ".public_ip_prefix") - - sku = _builder.get(".sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".sku") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - zones = _builder.get(".zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_public_ip_address_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_delete.py deleted file mode 100644 index 20706ec2f6d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip delete", -) -class Delete(AAZCommand): - """Delete a public IP address. - - :example: Delete a public IP address. - az network public-ip delete -g MyResourceGroup -n MyIp - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP address.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.PublicIPAddressesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class PublicIPAddressesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_list.py deleted file mode 100644 index f1e1dd441cf..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_list.py +++ /dev/null @@ -1,1524 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip list", -) -class List(AAZCommand): - """List public IP addresses. - - :example: List all public IPs in a subscription. - az network public-ip list - - :example: List all public IPs in a resource group. - az network public-ip list -g MyResourceGroup - - :example: List all public IPs of a domain name label. - az network public-ip list -g MyResourceGroup --query "[?dnsSettings.domainNameLabel=='MyLabel']" - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/publicipaddresses", "2018-11-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.PublicIPAddressesList(ctx=self.ctx)() - if condition_1: - self.PublicIPAddressesListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class PublicIPAddressesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_public_ip_address_read(value.Element) - - return cls._schema_on_200 - - class PublicIPAddressesListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_public_ip_address_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_show.py deleted file mode 100644 index 20133f8ecbf..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_show.py +++ /dev/null @@ -1,1441 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip show", -) -class Show(AAZCommand): - """Get the details of a public IP address. - - :example: Get information about a public IP resource. - az network public-ip show -g MyResourceGroup -n MyIp - - :example: Get the FQDN and IP address of a public IP resource. - az network public-ip show -g MyResourceGroup -n MyIp --query "{fqdn: dnsSettings.fqdn,address: ipAddress}" - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP address.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PublicIPAddressesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class PublicIPAddressesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_public_ip_address_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_update.py deleted file mode 100644 index d884122dc4d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_update.py +++ /dev/null @@ -1,1698 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip update", -) -class Update(AAZCommand): - """Update a public IP address. - - :example: Update a public IP resource with a DNS name label and static allocation. - az network public-ip update -g MyResourceGroup -n MyIp --dns-name MyLabel --allocation-method Static - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP address.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.dns_name = AAZStrArg( - options=["--dns-name"], - help="Globally unique DNS entry.", - nullable=True, - ) - _args_schema.reverse_fqdn = AAZStrArg( - options=["--reverse-fqdn"], - help="Reverse FQDN (fully qualified domain name).", - nullable=True, - ) - _args_schema.idle_timeout = AAZIntArg( - options=["--idle-timeout"], - help="Idle timeout in minutes.", - nullable=True, - ) - _args_schema.ip_tags = AAZListArg( - options=["--ip-tags"], - help="Space-separated list of IP tags in 'TYPE=VAL' format.", - nullable=True, - ) - _args_schema.version = AAZStrArg( - options=["--version"], - help="IP address type.", - default="IPv4", - nullable=True, - enum={"IPv4": "IPv4", "IPv6": "IPv6"}, - ) - _args_schema.allocation_method = AAZStrArg( - options=["--allocation-method"], - help="IP address allocation method.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _args_schema.public_ip_prefix = AAZStrArg( - options=["--public-ip-prefix"], - help="Name or ID of a public IP prefix.", - nullable=True, - ) - _args_schema.sku = AAZStrArg( - options=["--sku"], - help="Name of a public IP address SKU.", - nullable=True, - enum={"Basic": "Basic", "Standard": "Standard"}, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - ip_tags = cls._args_schema.ip_tags - ip_tags.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.ip_tags.Element - _element.ip_tag_type = AAZStrArg( - options=["ip-tag-type"], - help="The IP tag type. Example: FirstPartyUsage.", - nullable=True, - ) - _element.tag = AAZStrArg( - options=["tag"], - help="The value of the IP tag associated with the public IP. Example: SQL.", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "DdosSettings" - - # define Arg Group "DnsSettings" - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PublicIPAddressesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.PublicIPAddressesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class PublicIPAddressesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_public_ip_address_read(cls._schema_on_200) - - return cls._schema_on_200 - - class PublicIPAddressesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_public_ip_address_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("sku", AAZObjectType) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("ddosSettings", AAZObjectType) - properties.set_prop("dnsSettings", AAZObjectType) - properties.set_prop("idleTimeoutInMinutes", AAZIntType, ".idle_timeout") - properties.set_prop("ipTags", AAZListType, ".ip_tags") - properties.set_prop("publicIPAddressVersion", AAZStrType, ".version") - properties.set_prop("publicIPAllocationMethod", AAZStrType, ".allocation_method") - properties.set_prop("publicIPPrefix", AAZObjectType) - - dns_settings = _builder.get(".properties.dnsSettings") - if dns_settings is not None: - dns_settings.set_prop("domainNameLabel", AAZStrType, ".dns_name") - dns_settings.set_prop("reverseFqdn", AAZStrType, ".reverse_fqdn") - - ip_tags = _builder.get(".properties.ipTags") - if ip_tags is not None: - ip_tags.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipTags[]") - if _elements is not None: - _elements.set_prop("ipTagType", AAZStrType, ".ip_tag_type") - _elements.set_prop("tag", AAZStrType, ".tag") - - public_ip_prefix = _builder.get(".properties.publicIPPrefix") - if public_ip_prefix is not None: - public_ip_prefix.set_prop("id", AAZStrType, ".public_ip_prefix") - - sku = _builder.get(".sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".sku") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_wait.py deleted file mode 100644 index abea3bb108a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/_wait.py +++ /dev/null @@ -1,1434 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipaddresses/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP address.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PublicIPAddressesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class PublicIPAddressesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpAddressName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_public_ip_address_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.etag = AAZStrType() - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_security_group_read.etag - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.etag = AAZStrType() - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.etag = cls._schema_security_rule_read.etag - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/__cmd_group.py deleted file mode 100644 index 7c705c239c4..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 public-ip prefix", -) -class __CMDGroup(AAZCommandGroup): - """Manage public IP prefix resources. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_create.py deleted file mode 100644 index 7708284ba05..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_create.py +++ /dev/null @@ -1,325 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip prefix create", -) -class Create(AAZCommand): - """Create a public IP prefix resource. - - :example: Create a public IP prefix resource. (autogenerated) - az network public-ip prefix create --length 28 --location westus2 --name MyPublicIPPrefix --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipprefixes/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP prefix.", - required=True, - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.length = AAZIntArg( - options=["--length"], - help="Length of the prefix (i.e. `XX.XX.XX.XX/`).", - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - _args_schema.zone = AAZListArg( - options=["-z", "--zone"], - help="Space-separated list of availability zones into which to provision the resource. Allowed values: 1, 2, 3.", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - zone = cls._args_schema.zone - zone.Element = AAZStrArg() - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.sku = AAZObjectArg( - options=["--sku"], - arg_group="Parameters", - help="The public IP prefix SKU.", - ) - - sku = cls._args_schema.sku - sku.name = AAZStrArg( - options=["name"], - help="Name of a public IP prefix SKU.", - default="Standard", - enum={"Standard": "Standard"}, - ) - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.PublicIPPrefixesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class PublicIPPrefixesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpPrefixName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("sku", AAZObjectType, ".sku") - _builder.set_prop("tags", AAZDictType, ".tags") - _builder.set_prop("zones", AAZListType, ".zone") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("prefixLength", AAZIntType, ".length") - - sku = _builder.get(".sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".name") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - zones = _builder.get(".zones") - if zones is not None: - zones.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.location = AAZStrType() - _schema_on_200_201.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200_201.sku = AAZObjectType() - _schema_on_200_201.tags = AAZDictType() - _schema_on_200_201.type = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.zones = AAZListType() - - properties = cls._schema_on_200_201.properties - properties.ip_prefix = AAZStrType( - serialized_name="ipPrefix", - ) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.load_balancer_frontend_ip_configuration = AAZObjectType( - serialized_name="loadBalancerFrontendIpConfiguration", - ) - properties.prefix_length = AAZIntType( - serialized_name="prefixLength", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_addresses = AAZListType( - serialized_name="publicIPAddresses", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ip_tags = cls._schema_on_200_201.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - load_balancer_frontend_ip_configuration = cls._schema_on_200_201.properties.load_balancer_frontend_ip_configuration - load_balancer_frontend_ip_configuration.id = AAZStrType() - - public_ip_addresses = cls._schema_on_200_201.properties.public_ip_addresses - public_ip_addresses.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.public_ip_addresses.Element - _element.id = AAZStrType() - - sku = cls._schema_on_200_201.sku - sku.name = AAZStrType() - - tags = cls._schema_on_200_201.tags - tags.Element = AAZStrType() - - zones = cls._schema_on_200_201.zones - zones.Element = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_delete.py deleted file mode 100644 index 1093873f873..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip prefix delete", -) -class Delete(AAZCommand): - """Delete a public IP prefix resource. - - :example: Delete a public IP prefix resource. (autogenerated) - az network public-ip prefix delete --name MyPublicIPPrefix --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipprefixes/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP prefix.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.PublicIPPrefixesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class PublicIPPrefixesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpPrefixName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_list.py deleted file mode 100644 index b89d1c4eef6..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_list.py +++ /dev/null @@ -1,388 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip prefix list", -) -class List(AAZCommand): - """List public IP prefix resources. - - :example: List public IP prefix resource. - az network public-ip prefix list --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/publicipprefixes", "2018-11-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipprefixes", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.PublicIPPrefixesList(ctx=self.ctx)() - if condition_1: - self.PublicIPPrefixesListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class PublicIPPrefixesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.sku = AAZObjectType() - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - _element.zones = AAZListType() - - properties = cls._schema_on_200.value.Element.properties - properties.ip_prefix = AAZStrType( - serialized_name="ipPrefix", - ) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.load_balancer_frontend_ip_configuration = AAZObjectType( - serialized_name="loadBalancerFrontendIpConfiguration", - ) - properties.prefix_length = AAZIntType( - serialized_name="prefixLength", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_addresses = AAZListType( - serialized_name="publicIPAddresses", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ip_tags = cls._schema_on_200.value.Element.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - load_balancer_frontend_ip_configuration = cls._schema_on_200.value.Element.properties.load_balancer_frontend_ip_configuration - load_balancer_frontend_ip_configuration.id = AAZStrType() - - public_ip_addresses = cls._schema_on_200.value.Element.properties.public_ip_addresses - public_ip_addresses.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.public_ip_addresses.Element - _element.id = AAZStrType() - - sku = cls._schema_on_200.value.Element.sku - sku.name = AAZStrType() - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - zones = cls._schema_on_200.value.Element.zones - zones.Element = AAZStrType() - - return cls._schema_on_200 - - class PublicIPPrefixesListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.sku = AAZObjectType() - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - _element.zones = AAZListType() - - properties = cls._schema_on_200.value.Element.properties - properties.ip_prefix = AAZStrType( - serialized_name="ipPrefix", - ) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.load_balancer_frontend_ip_configuration = AAZObjectType( - serialized_name="loadBalancerFrontendIpConfiguration", - ) - properties.prefix_length = AAZIntType( - serialized_name="prefixLength", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_addresses = AAZListType( - serialized_name="publicIPAddresses", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ip_tags = cls._schema_on_200.value.Element.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - load_balancer_frontend_ip_configuration = cls._schema_on_200.value.Element.properties.load_balancer_frontend_ip_configuration - load_balancer_frontend_ip_configuration.id = AAZStrType() - - public_ip_addresses = cls._schema_on_200.value.Element.properties.public_ip_addresses - public_ip_addresses.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.public_ip_addresses.Element - _element.id = AAZStrType() - - sku = cls._schema_on_200.value.Element.sku - sku.name = AAZStrType() - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - zones = cls._schema_on_200.value.Element.zones - zones.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_show.py deleted file mode 100644 index aa89b8d9e59..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_show.py +++ /dev/null @@ -1,239 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip prefix show", -) -class Show(AAZCommand): - """Get the details of a public IP prefix resource. - - :example: Get the details of a public IP prefix resource. (autogenerated) - az network public-ip prefix show --name MyPublicIPPrefix --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipprefixes/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP prefix.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PublicIPPrefixesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class PublicIPPrefixesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpPrefixName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.sku = AAZObjectType() - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.zones = AAZListType() - - properties = cls._schema_on_200.properties - properties.ip_prefix = AAZStrType( - serialized_name="ipPrefix", - ) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.load_balancer_frontend_ip_configuration = AAZObjectType( - serialized_name="loadBalancerFrontendIpConfiguration", - ) - properties.prefix_length = AAZIntType( - serialized_name="prefixLength", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_addresses = AAZListType( - serialized_name="publicIPAddresses", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ip_tags = cls._schema_on_200.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - load_balancer_frontend_ip_configuration = cls._schema_on_200.properties.load_balancer_frontend_ip_configuration - load_balancer_frontend_ip_configuration.id = AAZStrType() - - public_ip_addresses = cls._schema_on_200.properties.public_ip_addresses - public_ip_addresses.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.public_ip_addresses.Element - _element.id = AAZStrType() - - sku = cls._schema_on_200.sku - sku.name = AAZStrType() - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - zones = cls._schema_on_200.zones - zones.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_update.py deleted file mode 100644 index 85b3d450de0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_update.py +++ /dev/null @@ -1,430 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip prefix update", -) -class Update(AAZCommand): - """Update a public IP prefix resource. - - :example: Update a public IP prefix resource. (autogenerated) - az network public-ip prefix update --name MyPublicIPPrefix --resource-group MyResourceGroup --set useRemoteGateways=true - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipprefixes/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP prefix.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PublicIPPrefixesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.PublicIPPrefixesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class PublicIPPrefixesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpPrefixName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_public_ip_prefix_read(cls._schema_on_200) - - return cls._schema_on_200 - - class PublicIPPrefixesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpPrefixName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_public_ip_prefix_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_public_ip_prefix_read = None - - @classmethod - def _build_schema_public_ip_prefix_read(cls, _schema): - if cls._schema_public_ip_prefix_read is not None: - _schema.etag = cls._schema_public_ip_prefix_read.etag - _schema.id = cls._schema_public_ip_prefix_read.id - _schema.location = cls._schema_public_ip_prefix_read.location - _schema.name = cls._schema_public_ip_prefix_read.name - _schema.properties = cls._schema_public_ip_prefix_read.properties - _schema.sku = cls._schema_public_ip_prefix_read.sku - _schema.tags = cls._schema_public_ip_prefix_read.tags - _schema.type = cls._schema_public_ip_prefix_read.type - _schema.zones = cls._schema_public_ip_prefix_read.zones - return - - cls._schema_public_ip_prefix_read = _schema_public_ip_prefix_read = AAZObjectType() - - public_ip_prefix_read = _schema_public_ip_prefix_read - public_ip_prefix_read.etag = AAZStrType() - public_ip_prefix_read.id = AAZStrType() - public_ip_prefix_read.location = AAZStrType() - public_ip_prefix_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_prefix_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_prefix_read.sku = AAZObjectType() - public_ip_prefix_read.tags = AAZDictType() - public_ip_prefix_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_prefix_read.zones = AAZListType() - - properties = _schema_public_ip_prefix_read.properties - properties.ip_prefix = AAZStrType( - serialized_name="ipPrefix", - ) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.load_balancer_frontend_ip_configuration = AAZObjectType( - serialized_name="loadBalancerFrontendIpConfiguration", - ) - properties.prefix_length = AAZIntType( - serialized_name="prefixLength", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_addresses = AAZListType( - serialized_name="publicIPAddresses", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ip_tags = _schema_public_ip_prefix_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_prefix_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - load_balancer_frontend_ip_configuration = _schema_public_ip_prefix_read.properties.load_balancer_frontend_ip_configuration - load_balancer_frontend_ip_configuration.id = AAZStrType() - - public_ip_addresses = _schema_public_ip_prefix_read.properties.public_ip_addresses - public_ip_addresses.Element = AAZObjectType() - - _element = _schema_public_ip_prefix_read.properties.public_ip_addresses.Element - _element.id = AAZStrType() - - sku = _schema_public_ip_prefix_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_prefix_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_prefix_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_prefix_read.etag - _schema.id = cls._schema_public_ip_prefix_read.id - _schema.location = cls._schema_public_ip_prefix_read.location - _schema.name = cls._schema_public_ip_prefix_read.name - _schema.properties = cls._schema_public_ip_prefix_read.properties - _schema.sku = cls._schema_public_ip_prefix_read.sku - _schema.tags = cls._schema_public_ip_prefix_read.tags - _schema.type = cls._schema_public_ip_prefix_read.type - _schema.zones = cls._schema_public_ip_prefix_read.zones - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_wait.py deleted file mode 100644 index 7acce193284..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/public_ip/prefix/_wait.py +++ /dev/null @@ -1,235 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network public-ip prefix wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/publicipprefixes/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the public IP prefix.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.PublicIPPrefixesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class PublicIPPrefixesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "publicIpPrefixName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.sku = AAZObjectType() - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.zones = AAZListType() - - properties = cls._schema_on_200.properties - properties.ip_prefix = AAZStrType( - serialized_name="ipPrefix", - ) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.load_balancer_frontend_ip_configuration = AAZObjectType( - serialized_name="loadBalancerFrontendIpConfiguration", - ) - properties.prefix_length = AAZIntType( - serialized_name="prefixLength", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_addresses = AAZListType( - serialized_name="publicIPAddresses", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ip_tags = cls._schema_on_200.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - load_balancer_frontend_ip_configuration = cls._schema_on_200.properties.load_balancer_frontend_ip_configuration - load_balancer_frontend_ip_configuration.id = AAZStrType() - - public_ip_addresses = cls._schema_on_200.properties.public_ip_addresses - public_ip_addresses.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.public_ip_addresses.Element - _element.id = AAZStrType() - - sku = cls._schema_on_200.sku - sku.name = AAZStrType() - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - zones = cls._schema_on_200.zones - zones.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/__cmd_group.py deleted file mode 100644 index 88087e0bdc5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 route-table", -) -class __CMDGroup(AAZCommandGroup): - """Manage route tables. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_create.py deleted file mode 100644 index 1b4e555885f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_create.py +++ /dev/null @@ -1,1518 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table create", -) -class Create(AAZCommand): - """Create a route table. - - :example: Create a route table. - az network route-table create -g MyResourceGroup -n MyRouteTable - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the route table.", - required=True, - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - arg_group="Parameters", - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Parameters", - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.disable_bgp_route_propagation = AAZBoolArg( - options=["--disable-bgp-route-propagation"], - arg_group="Properties", - help="Disable routes learned by BGP. Allowed values: false, true.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.RouteTablesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RouteTablesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("disableBgpRoutePropagation", AAZBoolType, ".disable_bgp_route_propagation") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_route_table_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_route_table_read = None - - @classmethod - def _build_schema_route_table_read(cls, _schema): - if cls._schema_route_table_read is not None: - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - return - - cls._schema_route_table_read = _schema_route_table_read = AAZObjectType() - - route_table_read = _schema_route_table_read - route_table_read.etag = AAZStrType() - route_table_read.id = AAZStrType() - route_table_read.location = AAZStrType() - route_table_read.name = AAZStrType( - flags={"read_only": True}, - ) - route_table_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table_read.tags = AAZDictType() - route_table_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_route_table_read.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_route_table_read.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_route_table_read.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_table_read.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_route_table_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_route_table_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - cls._build_schema_route_table_read(properties.route_table) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_delete.py deleted file mode 100644 index bacbf444d68..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_delete.py +++ /dev/null @@ -1,163 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table delete", - confirmation="Are you sure you want to perform this operation?", -) -class Delete(AAZCommand): - """Delete a route table. - - :example: Delete a route table. - az network route-table delete -g MyResourceGroup -n MyRouteTable - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the route table.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.RouteTablesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class RouteTablesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_list.py deleted file mode 100644 index 8d30c7278bf..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_list.py +++ /dev/null @@ -1,1537 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table list", -) -class List(AAZCommand): - """List route tables. - - :example: List all route tables in a subscription. - az network route-table list -g MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/routetables", "2018-11-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.RouteTablesList(ctx=self.ctx)() - if condition_1: - self.RouteTablesListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class RouteTablesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_route_table_read(value.Element) - - return cls._schema_on_200 - - class RouteTablesListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_route_table_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_route_table_read = None - - @classmethod - def _build_schema_route_table_read(cls, _schema): - if cls._schema_route_table_read is not None: - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - return - - cls._schema_route_table_read = _schema_route_table_read = AAZObjectType() - - route_table_read = _schema_route_table_read - route_table_read.etag = AAZStrType() - route_table_read.id = AAZStrType() - route_table_read.location = AAZStrType() - route_table_read.name = AAZStrType( - flags={"read_only": True}, - ) - route_table_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table_read.tags = AAZDictType() - route_table_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_route_table_read.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_route_table_read.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_route_table_read.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_table_read.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_route_table_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_route_table_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - cls._build_schema_route_table_read(properties.route_table) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_show.py deleted file mode 100644 index 5da787cd9d5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_show.py +++ /dev/null @@ -1,1457 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table show", -) -class Show(AAZCommand): - """Get the details of a route table. - - :example: Get the details of a route table. - az network route-table show -g MyResourceGroup -n MyRouteTable - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the route table.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RouteTablesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RouteTablesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_route_table_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_route_table_read = None - - @classmethod - def _build_schema_route_table_read(cls, _schema): - if cls._schema_route_table_read is not None: - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - return - - cls._schema_route_table_read = _schema_route_table_read = AAZObjectType() - - route_table_read = _schema_route_table_read - route_table_read.etag = AAZStrType() - route_table_read.id = AAZStrType() - route_table_read.location = AAZStrType() - route_table_read.name = AAZStrType( - flags={"read_only": True}, - ) - route_table_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table_read.tags = AAZDictType() - route_table_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_route_table_read.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_route_table_read.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_route_table_read.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_table_read.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_route_table_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_route_table_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - cls._build_schema_route_table_read(properties.route_table) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_update.py deleted file mode 100644 index d3ef3d9632b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_update.py +++ /dev/null @@ -1,1634 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table update", -) -class Update(AAZCommand): - """Update a route table. - - :example: Update a route table to disable BGP route propagation. - az network route-table update -g MyResourceGroup -n MyRouteTable --disable-bgp-route-propagation true - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the route table.", - required=True, - id_part="name", - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.tags = AAZDictArg( - options=["--tags"], - arg_group="Parameters", - help="Space-separated tags: key[=value] [key[=value] ...].", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.disable_bgp_route_propagation = AAZBoolArg( - options=["--disable-bgp-route-propagation"], - arg_group="Properties", - help="Disable routes learned by BGP. Allowed values: false, true.", - nullable=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RouteTablesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.RouteTablesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RouteTablesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_route_table_read(cls._schema_on_200) - - return cls._schema_on_200 - - class RouteTablesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_route_table_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("disableBgpRoutePropagation", AAZBoolType, ".disable_bgp_route_propagation") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_route_table_read = None - - @classmethod - def _build_schema_route_table_read(cls, _schema): - if cls._schema_route_table_read is not None: - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - return - - cls._schema_route_table_read = _schema_route_table_read = AAZObjectType() - - route_table_read = _schema_route_table_read - route_table_read.etag = AAZStrType() - route_table_read.id = AAZStrType() - route_table_read.location = AAZStrType() - route_table_read.name = AAZStrType( - flags={"read_only": True}, - ) - route_table_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table_read.tags = AAZDictType() - route_table_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_route_table_read.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_route_table_read.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_route_table_read.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_table_read.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_route_table_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_route_table_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - cls._build_schema_route_table_read(properties.route_table) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_wait.py deleted file mode 100644 index bb0b2816a80..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/_wait.py +++ /dev/null @@ -1,1453 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the route table.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RouteTablesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class RouteTablesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_route_table_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_route_table_read = None - - @classmethod - def _build_schema_route_table_read(cls, _schema): - if cls._schema_route_table_read is not None: - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - return - - cls._schema_route_table_read = _schema_route_table_read = AAZObjectType() - - route_table_read = _schema_route_table_read - route_table_read.etag = AAZStrType() - route_table_read.id = AAZStrType() - route_table_read.location = AAZStrType() - route_table_read.name = AAZStrType( - flags={"read_only": True}, - ) - route_table_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table_read.tags = AAZDictType() - route_table_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_route_table_read.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_route_table_read.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_route_table_read.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_table_read.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_route_table_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_route_table_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_route_table_read.etag - _schema.id = cls._schema_route_table_read.id - _schema.location = cls._schema_route_table_read.location - _schema.name = cls._schema_route_table_read.name - _schema.properties = cls._schema_route_table_read.properties - _schema.tags = cls._schema_route_table_read.tags - _schema.type = cls._schema_route_table_read.type - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - cls._build_schema_route_table_read(properties.route_table) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/__cmd_group.py deleted file mode 100644 index 1eeb0b10800..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 route-table route", -) -class __CMDGroup(AAZCommandGroup): - """Manage routes in a route table. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_create.py deleted file mode 100644 index fab8f2f3408..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_create.py +++ /dev/null @@ -1,253 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route create", -) -class Create(AAZCommand): - """Create a route in a route table. - - :example: Create a route that forces all inbound traffic to a Network Virtual Appliance. - az network route-table route create -g MyResourceGroup --route-table-name MyRouteTable -n MyRoute --next-hop-type VirtualAppliance --address-prefix 10.0.0.0/16 --next-hop-ip-address 10.0.100.4 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Route name.", - required=True, - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.address_prefix = AAZStrArg( - options=["--address-prefix"], - arg_group="Properties", - help="The destination CIDR to which the route applies.", - ) - _args_schema.next_hop_ip_address = AAZStrArg( - options=["--next-hop-ip-address"], - arg_group="Properties", - help="The IP address packets should be forwarded to when using the VirtualAppliance hop type.", - ) - _args_schema.next_hop_type = AAZStrArg( - options=["--next-hop-type"], - arg_group="Properties", - help="The type of Azure hop the packet should be sent to.", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - - # define Arg Group "RouteParameters" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.RoutesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RoutesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.name = AAZStrType() - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_delete.py deleted file mode 100644 index 0d494f7dd69..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_delete.py +++ /dev/null @@ -1,173 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route delete", - confirmation="Are you sure you want to perform this operation?", -) -class Delete(AAZCommand): - """Delete a route from a route table. - - :example: Delete a route from a route table. - az network route-table route delete -g MyResourceGroup --route-table-name MyRouteTable -n MyRoute - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Route name.", - required=True, - id_part="child_name_1", - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.RoutesDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class RoutesDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_list.py deleted file mode 100644 index 1c4d2428edf..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_list.py +++ /dev/null @@ -1,193 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route list", -) -class List(AAZCommand): - """List routes in a route table. - - :example: List routes in a route table. - az network route-table route list -g MyResourceGroup --route-table-name MyRouteTable - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RoutesList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class RoutesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_show.py deleted file mode 100644 index c9b9d309382..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_show.py +++ /dev/null @@ -1,195 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route show", -) -class Show(AAZCommand): - """Get the details of a route in a route table. - - :example: Get the details of a route in a route table. - az network route-table route show -g MyResourceGroup --route-table-name MyRouteTable -n MyRoute -o table - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Route name.", - required=True, - id_part="child_name_1", - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RoutesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RoutesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_update.py deleted file mode 100644 index 78dd2e8bd80..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_update.py +++ /dev/null @@ -1,402 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route update", -) -class Update(AAZCommand): - """Update a route in a route table. - - :example: Update a route in a route table to change the next hop ip address. - az network route-table route update -g MyResourceGroup --route-table-name MyRouteTable -n MyRoute --next-hop-ip-address 10.0.100.5 - - :example: Update a route in a route table. - az network route-table route update --address-prefix 10.0.0.0/16 --name MyRoute --next-hop-ip-address 10.0.100.5 --next-hop-type VirtualNetworkGateway --resource-group MyResourceGroup --route-table-name MyRouteTable - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Route name.", - required=True, - id_part="child_name_1", - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - id_part="name", - ) - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.address_prefix = AAZStrArg( - options=["--address-prefix"], - arg_group="Properties", - help="The destination CIDR to which the route applies.", - nullable=True, - ) - _args_schema.next_hop_ip_address = AAZStrArg( - options=["--next-hop-ip-address"], - arg_group="Properties", - help="The IP address packets should be forwarded to when using the VirtualAppliance hop type.", - nullable=True, - ) - _args_schema.next_hop_type = AAZStrArg( - options=["--next-hop-type"], - arg_group="Properties", - help="The type of Azure hop the packet should be sent to.", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - - # define Arg Group "RouteParameters" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RoutesGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.RoutesCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class RoutesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_route_read(cls._schema_on_200) - - return cls._schema_on_200 - - class RoutesCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_route_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_route_read = None - - @classmethod - def _build_schema_route_read(cls, _schema): - if cls._schema_route_read is not None: - _schema.etag = cls._schema_route_read.etag - _schema.id = cls._schema_route_read.id - _schema.name = cls._schema_route_read.name - _schema.properties = cls._schema_route_read.properties - return - - cls._schema_route_read = _schema_route_read = AAZObjectType() - - route_read = _schema_route_read - route_read.etag = AAZStrType() - route_read.id = AAZStrType() - route_read.name = AAZStrType() - route_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_route_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - _schema.etag = cls._schema_route_read.etag - _schema.id = cls._schema_route_read.id - _schema.name = cls._schema_route_read.name - _schema.properties = cls._schema_route_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_wait.py deleted file mode 100644 index e023911be10..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/route_table/route/_wait.py +++ /dev/null @@ -1,191 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network route-table route wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/routetables/{}/routes/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Route name.", - required=True, - id_part="child_name_1", - ) - _args_schema.route_table_name = AAZStrArg( - options=["--route-table-name"], - help="Route table name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.RoutesGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class RoutesGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "routeName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "routeTableName", self.ctx.args.route_table_name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/__cmd_group.py deleted file mode 100644 index 8db8cccf4a5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet", -) -class __CMDGroup(AAZCommandGroup): - """Check if a private IP address is available for use within a virtual network. - - To learn more about Virtual Networks visit https://learn.microsoft.com/azure/virtual-network/virtual-network-manage-network. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/__init__.py deleted file mode 100644 index c352aa0e33a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._check_ip_address import * -from ._create import * -from ._delete import * -from ._list import * -from ._list_endpoint_services import * -from ._show import * -from ._update import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_check_ip_address.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_check_ip_address.py deleted file mode 100644 index e7f492ec935..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_check_ip_address.py +++ /dev/null @@ -1,180 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet check-ip-address", -) -class CheckIpAddress(AAZCommand): - """Check if a private IP address is available for use within a virtual network. - - :example: Check whether 10.0.0.4 is available within MyVnet. - az network vnet check-ip-address -g MyResourceGroup -n MyVnet --ip-address 10.0.0.4 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/checkipaddressavailability", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.ip_address = AAZStrArg( - options=["--ip-address"], - help="The private IP address to be verified.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworksCheckIPAddressAvailability(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworksCheckIPAddressAvailability(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "ipAddress", self.ctx.args.ip_address, - required=True, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.available = AAZBoolType() - _schema_on_200.available_ip_addresses = AAZListType( - serialized_name="availableIPAddresses", - ) - - available_ip_addresses = cls._schema_on_200.available_ip_addresses - available_ip_addresses.Element = AAZStrType() - - return cls._schema_on_200 - - -class _CheckIpAddressHelper: - """Helper class for CheckIpAddress""" - - -__all__ = ["CheckIpAddress"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_create.py deleted file mode 100644 index 5306a608f1c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_create.py +++ /dev/null @@ -1,2523 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet create", -) -class Create(AAZCommand): - """Create a virtual network. - - You may also create a subnet at the same time by specifying a subnet name and (optionally) an address prefix. To learn about how to create a virtual network visit https://learn.microsoft.com/azure/virtual-network/manage-virtual-network#create-a-virtual-network. - - :example: Create a virtual network with a specific address prefix and one subnet. - az network vnet create -g MyResourceGroup -n MyVnet --address-prefix 10.0.0.0/16 --subnet-name MySubnet --subnet-prefixes 10.0.0.0/24 - - :example: Create a virtual network. - az network vnet create --address-prefixes 10.0.0.0/16 --name MyVirtualNetwork --resource-group MyResourceGroup --subnet-name MyAseSubnet --subnet-prefixes 10.0.0.0/24 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.address_prefixes = AAZListArg( - options=["--address-prefixes"], - help="Space-separated list of IP address prefixes for the VNet. Default: 10.0.0.0/16.", - default=["10.0.0.0/16"], - ) - _args_schema.ddos_protection_plan = AAZStrArg( - options=["--ddos-protection-plan"], - help="Name or ID of a DDoS protection plan to associate with the VNet.", - ) - _args_schema.dns_servers = AAZListArg( - options=["--dns-servers"], - help="Space-separated list of DNS server IP addresses.", - ) - _args_schema.ddos_protection = AAZBoolArg( - options=["--ddos-protection"], - help="Control whether DDoS protection is enabled.", - default=False, - ) - _args_schema.vm_protection = AAZBoolArg( - options=["--vm-protection"], - help="Enable VM protection for all subnets in the VNet.", - default=False, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...].", - ) - - address_prefixes = cls._args_schema.address_prefixes - address_prefixes.Element = AAZStrArg() - - dns_servers = cls._args_schema.dns_servers - dns_servers.Element = AAZStrArg() - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - # define Arg Group "Subnet" - - _args_schema = cls._args_schema - _args_schema.subnets = AAZListArg( - options=["--subnets"], - arg_group="Subnet", - help="Manage a list of subnets in a Virtual Network (similar to `az network vnet subnet`).", - ) - - subnets = cls._args_schema.subnets - subnets.Element = AAZObjectArg() - - _element = cls._args_schema.subnets.Element - _element.name = AAZStrArg( - options=["name"], - help="The subnet name.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The address prefix for the subnet.", - ) - _element.address_prefixes = AAZListArg( - options=["address-prefixes"], - help="List of address prefixes for the subnet.", - ) - _element.delegations = AAZListArg( - options=["delegations"], - help="An array of references to the delegations on the subnet.", - ) - _element.network_security_group = AAZObjectArg( - options=["nsg", "network-security-group"], - help="The reference to the NetworkSecurityGroup resource.", - ) - _element.route_table = AAZObjectArg( - options=["route-table"], - help="The reference to the RouteTable resource.", - ) - _element.service_endpoint_policy = AAZListArg( - options=["service-endpoint-policy"], - help="An array of service endpoint policies.", - ) - _element.service_endpoints = AAZListArg( - options=["service-endpoints"], - help="An array of service endpoints.", - ) - - address_prefixes = cls._args_schema.subnets.Element.address_prefixes - address_prefixes.Element = AAZStrArg() - - delegations = cls._args_schema.subnets.Element.delegations - delegations.Element = AAZObjectArg() - - _element = cls._args_schema.subnets.Element.delegations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a subnet. This name can be used to access the resource.", - ) - _element.actions = AAZListArg( - options=["actions"], - help="Describes the actions permitted to the service upon delegation", - ) - _element.service_name = AAZStrArg( - options=["service-name"], - help="The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers).", - ) - - actions = cls._args_schema.subnets.Element.delegations.Element.actions - actions.Element = AAZStrArg() - - network_security_group = cls._args_schema.subnets.Element.network_security_group - network_security_group.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - network_security_group.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - network_security_group.default_security_rules = AAZListArg( - options=["default-security-rules"], - help="The default security rules of network security group.", - ) - network_security_group.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - network_security_group.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the network security group resource.", - ) - network_security_group.security_rules = AAZListArg( - options=["security-rules"], - help="A collection of security rules of the network security group.", - ) - network_security_group.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - default_security_rules = cls._args_schema.subnets.Element.network_security_group.default_security_rules - default_security_rules.Element = AAZObjectArg() - cls._build_args_security_rule_create(default_security_rules.Element) - - security_rules = cls._args_schema.subnets.Element.network_security_group.security_rules - security_rules.Element = AAZObjectArg() - - _element = cls._args_schema.subnets.Element.network_security_group.security_rules.Element - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - _element.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - _element.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - _element.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - _element.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - _element.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - _element.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - _element.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.", - ) - _element.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - _element.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - _element.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.", - ) - _element.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_schema.subnets.Element.network_security_group.security_rules.Element.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_schema.subnets.Element.network_security_group.security_rules.Element.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_schema.subnets.Element.network_security_group.security_rules.Element.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_schema.subnets.Element.network_security_group.security_rules.Element.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_schema.subnets.Element.network_security_group.security_rules.Element.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_schema.subnets.Element.network_security_group.security_rules.Element.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - tags = cls._args_schema.subnets.Element.network_security_group.tags - tags.Element = AAZStrArg() - - route_table = cls._args_schema.subnets.Element.route_table - route_table.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - ) - route_table.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - route_table.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - route_table.disable_bgp_route_propagation = AAZBoolArg( - options=["disable-bgp-route-propagation"], - help="Whether to disable the routes learned by BGP on that route table. True means disable.", - ) - route_table.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - route_table.routes = AAZListArg( - options=["routes"], - help="Collection of routes contained within a route table.", - ) - route_table.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - routes = cls._args_schema.subnets.Element.route_table.routes - routes.Element = AAZObjectArg() - - _element = cls._args_schema.subnets.Element.route_table.routes.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}/routes/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.address_prefix = AAZStrArg( - options=["address-prefix"], - help="The destination CIDR to which the route applies.", - ) - _element.next_hop_ip_address = AAZStrArg( - options=["next-hop-ip-address"], - help="The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.", - ) - _element.next_hop_type = AAZStrArg( - options=["next-hop-type"], - help="The type of Azure hop the packet should be sent to.", - enum={"Internet": "Internet", "None": "None", "VirtualAppliance": "VirtualAppliance", "VirtualNetworkGateway": "VirtualNetworkGateway", "VnetLocal": "VnetLocal"}, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - - tags = cls._args_schema.subnets.Element.route_table.tags - tags.Element = AAZStrArg() - - service_endpoint_policy = cls._args_schema.subnets.Element.service_endpoint_policy - service_endpoint_policy.Element = AAZObjectArg() - - _element = cls._args_schema.subnets.Element.service_endpoint_policy.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.service_endpoint_policy_definitions = AAZListArg( - options=["service-endpoint-policy-definitions"], - help="A collection of service endpoint policy definitions of the service endpoint policy.", - ) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - service_endpoint_policy_definitions = cls._args_schema.subnets.Element.service_endpoint_policy.Element.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectArg() - - _element = cls._args_schema.subnets.Element.service_endpoint_policy.Element.service_endpoint_policy_definitions.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}/serviceEndpointPolicyDefinitions/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.service = AAZStrArg( - options=["service"], - help="Service endpoint name.", - ) - _element.service_resources = AAZListArg( - options=["service-resources"], - help="A list of service resources.", - ) - - service_resources = cls._args_schema.subnets.Element.service_endpoint_policy.Element.service_endpoint_policy_definitions.Element.service_resources - service_resources.Element = AAZStrArg() - - tags = cls._args_schema.subnets.Element.service_endpoint_policy.Element.tags - tags.Element = AAZStrArg() - - service_endpoints = cls._args_schema.subnets.Element.service_endpoints - service_endpoints.Element = AAZObjectArg() - - _element = cls._args_schema.subnets.Element.service_endpoints.Element - _element.locations = AAZListArg( - options=["locations"], - help="A list of locations.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - ) - _element.service = AAZStrArg( - options=["service"], - help="The type of the endpoint service.", - ) - - locations = cls._args_schema.subnets.Element.service_endpoints.Element.locations - locations.Element = AAZStrArg() - return cls._args_schema - - _args_address_space_create = None - - @classmethod - def _build_args_address_space_create(cls, _schema): - if cls._args_address_space_create is not None: - _schema.address_prefixes = cls._args_address_space_create.address_prefixes - return - - cls._args_address_space_create = AAZObjectArg() - - address_space_create = cls._args_address_space_create - address_space_create.address_prefixes = AAZListArg( - options=["address-prefixes"], - help="A list of address blocks reserved for this virtual network in CIDR notation.", - ) - - address_prefixes = cls._args_address_space_create.address_prefixes - address_prefixes.Element = AAZStrArg() - - _schema.address_prefixes = cls._args_address_space_create.address_prefixes - - _args_application_security_group_create = None - - @classmethod - def _build_args_application_security_group_create(cls, _schema): - if cls._args_application_security_group_create is not None: - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - return - - cls._args_application_security_group_create = AAZObjectArg() - - application_security_group_create = cls._args_application_security_group_create - application_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - security_rule_create.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - security_rule_create.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_create.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworksCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworksCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressSpace", AAZObjectType) - properties.set_prop("ddosProtectionPlan", AAZObjectType) - properties.set_prop("dhcpOptions", AAZObjectType) - properties.set_prop("enableDdosProtection", AAZBoolType, ".ddos_protection") - properties.set_prop("enableVmProtection", AAZBoolType, ".vm_protection") - properties.set_prop("subnets", AAZListType, ".subnets") - - address_space = _builder.get(".properties.addressSpace") - if address_space is not None: - address_space.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".properties.addressSpace.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - ddos_protection_plan = _builder.get(".properties.ddosProtectionPlan") - if ddos_protection_plan is not None: - ddos_protection_plan.set_prop("id", AAZStrType, ".ddos_protection_plan") - - dhcp_options = _builder.get(".properties.dhcpOptions") - if dhcp_options is not None: - dhcp_options.set_prop("dnsServers", AAZListType, ".dns_servers") - - dns_servers = _builder.get(".properties.dhcpOptions.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - subnets = _builder.get(".properties.subnets") - if subnets is not None: - subnets.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.subnets[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.subnets[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - properties.set_prop("delegations", AAZListType, ".delegations") - properties.set_prop("networkSecurityGroup", AAZObjectType, ".network_security_group") - properties.set_prop("routeTable", AAZObjectType, ".route_table") - properties.set_prop("serviceEndpointPolicies", AAZListType, ".service_endpoint_policy") - properties.set_prop("serviceEndpoints", AAZListType, ".service_endpoints") - - address_prefixes = _builder.get(".properties.subnets[].properties.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - delegations = _builder.get(".properties.subnets[].properties.delegations") - if delegations is not None: - delegations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.subnets[].properties.delegations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.subnets[].properties.delegations[].properties") - if properties is not None: - properties.set_prop("actions", AAZListType, ".actions") - properties.set_prop("serviceName", AAZStrType, ".service_name") - - actions = _builder.get(".properties.subnets[].properties.delegations[].properties.actions") - if actions is not None: - actions.set_elements(AAZStrType, ".") - - network_security_group = _builder.get(".properties.subnets[].properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("id", AAZStrType, ".id") - network_security_group.set_prop("location", AAZStrType, ".location") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - network_security_group.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties") - if properties is not None: - properties.set_prop("defaultSecurityRules", AAZListType, ".default_security_rules") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("securityRules", AAZListType, ".security_rules") - - default_security_rules = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.defaultSecurityRules") - if default_security_rules is not None: - _CreateHelper._build_schema_security_rule_create(default_security_rules.set_elements(AAZObjectType, ".")) - - security_rules = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules") - if security_rules is not None: - security_rules.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[]") - if _elements is not None: - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - _CreateHelper._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - _CreateHelper._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.subnets[].properties.networkSecurityGroup.properties.securityRules[].properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.subnets[].properties.networkSecurityGroup.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - route_table = _builder.get(".properties.subnets[].properties.routeTable") - if route_table is not None: - route_table.set_prop("etag", AAZStrType, ".etag") - route_table.set_prop("id", AAZStrType, ".id") - route_table.set_prop("location", AAZStrType, ".location") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - route_table.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.subnets[].properties.routeTable.properties") - if properties is not None: - properties.set_prop("disableBgpRoutePropagation", AAZBoolType, ".disable_bgp_route_propagation") - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("routes", AAZListType, ".routes") - - routes = _builder.get(".properties.subnets[].properties.routeTable.properties.routes") - if routes is not None: - routes.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.subnets[].properties.routeTable.properties.routes[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.subnets[].properties.routeTable.properties.routes[].properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("nextHopIpAddress", AAZStrType, ".next_hop_ip_address") - properties.set_prop("nextHopType", AAZStrType, ".next_hop_type", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - - tags = _builder.get(".properties.subnets[].properties.routeTable.tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - service_endpoint_policies = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies") - if service_endpoint_policies is not None: - service_endpoint_policies.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies[].properties") - if properties is not None: - properties.set_prop("serviceEndpointPolicyDefinitions", AAZListType, ".service_endpoint_policy_definitions") - - service_endpoint_policy_definitions = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions") - if service_endpoint_policy_definitions is not None: - service_endpoint_policy_definitions.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties") - if properties is not None: - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("service", AAZStrType, ".service") - properties.set_prop("serviceResources", AAZListType, ".service_resources") - - service_resources = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties.serviceResources") - if service_resources is not None: - service_resources.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.subnets[].properties.serviceEndpointPolicies[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - service_endpoints = _builder.get(".properties.subnets[].properties.serviceEndpoints") - if service_endpoints is not None: - service_endpoints.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.subnets[].properties.serviceEndpoints[]") - if _elements is not None: - _elements.set_prop("locations", AAZListType, ".locations") - _elements.set_prop("provisioningState", AAZStrType, ".provisioning_state") - _elements.set_prop("service", AAZStrType, ".service") - - locations = _builder.get(".properties.subnets[].properties.serviceEndpoints[].locations") - if locations is not None: - locations.set_elements(AAZStrType, ".") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.location = AAZStrType() - _schema_on_200_201.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200_201.tags = AAZDictType() - _schema_on_200_201.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - _CreateHelper._build_schema_address_space_read(properties.address_space) - properties.ddos_protection_plan = AAZObjectType( - serialized_name="ddosProtectionPlan", - ) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.enable_ddos_protection = AAZBoolType( - serialized_name="enableDdosProtection", - ) - properties.enable_vm_protection = AAZBoolType( - serialized_name="enableVmProtection", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - properties.virtual_network_peerings = AAZListType( - serialized_name="virtualNetworkPeerings", - ) - - ddos_protection_plan = cls._schema_on_200_201.properties.ddos_protection_plan - ddos_protection_plan.id = AAZStrType() - - dhcp_options = cls._schema_on_200_201.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = cls._schema_on_200_201.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = cls._schema_on_200_201.properties.subnets - subnets.Element = AAZObjectType() - _CreateHelper._build_schema_subnet_read(subnets.Element) - - virtual_network_peerings = cls._schema_on_200_201.properties.virtual_network_peerings - virtual_network_peerings.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.virtual_network_peerings.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.virtual_network_peerings.Element.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - _CreateHelper._build_schema_address_space_read(properties.remote_address_space) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - _CreateHelper._build_schema_sub_resource_read(properties.remote_virtual_network) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - tags = cls._schema_on_200_201.tags - tags.Element = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_address_space_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_application_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_delete.py deleted file mode 100644 index e4304dac711..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet delete", -) -class Delete(AAZCommand): - """Delete a virtual network. - - :example: Delete a virtual network. - az network vnet delete -g MyResourceGroup -n myVNet - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworksDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class VirtualNetworksDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_list.py deleted file mode 100644 index 13f2b147e9e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_list.py +++ /dev/null @@ -1,1736 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet list", -) -class List(AAZCommand): - """List virtual networks. - - :example: List all virtual networks in a subscription. - az network vnet list - - :example: List all virtual networks in a resource group. - az network vnet list -g MyResourceGroup - - :example: List virtual networks in a subscription which specify a certain address prefix. - az network vnet list --query "[?contains(addressSpace.addressPrefixes, '10.0.0.0/16')]" - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/virtualnetworks", "2018-11-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.VirtualNetworksList(ctx=self.ctx)() - if condition_1: - self.VirtualNetworksListAll(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class VirtualNetworksList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - _ListHelper._build_schema_address_space_read(properties.address_space) - properties.ddos_protection_plan = AAZObjectType( - serialized_name="ddosProtectionPlan", - ) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.enable_ddos_protection = AAZBoolType( - serialized_name="enableDdosProtection", - ) - properties.enable_vm_protection = AAZBoolType( - serialized_name="enableVmProtection", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - properties.virtual_network_peerings = AAZListType( - serialized_name="virtualNetworkPeerings", - ) - - ddos_protection_plan = cls._schema_on_200.value.Element.properties.ddos_protection_plan - ddos_protection_plan.id = AAZStrType() - - dhcp_options = cls._schema_on_200.value.Element.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = cls._schema_on_200.value.Element.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = cls._schema_on_200.value.Element.properties.subnets - subnets.Element = AAZObjectType() - _ListHelper._build_schema_subnet_read(subnets.Element) - - virtual_network_peerings = cls._schema_on_200.value.Element.properties.virtual_network_peerings - virtual_network_peerings.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.virtual_network_peerings.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.virtual_network_peerings.Element.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - _ListHelper._build_schema_address_space_read(properties.remote_address_space) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - _ListHelper._build_schema_sub_resource_read(properties.remote_virtual_network) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - class VirtualNetworksListAll(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - _ListHelper._build_schema_address_space_read(properties.address_space) - properties.ddos_protection_plan = AAZObjectType( - serialized_name="ddosProtectionPlan", - ) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.enable_ddos_protection = AAZBoolType( - serialized_name="enableDdosProtection", - ) - properties.enable_vm_protection = AAZBoolType( - serialized_name="enableVmProtection", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - properties.virtual_network_peerings = AAZListType( - serialized_name="virtualNetworkPeerings", - ) - - ddos_protection_plan = cls._schema_on_200.value.Element.properties.ddos_protection_plan - ddos_protection_plan.id = AAZStrType() - - dhcp_options = cls._schema_on_200.value.Element.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = cls._schema_on_200.value.Element.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = cls._schema_on_200.value.Element.properties.subnets - subnets.Element = AAZObjectType() - _ListHelper._build_schema_subnet_read(subnets.Element) - - virtual_network_peerings = cls._schema_on_200.value.Element.properties.virtual_network_peerings - virtual_network_peerings.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.virtual_network_peerings.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.virtual_network_peerings.Element.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - _ListHelper._build_schema_address_space_read(properties.remote_address_space) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - _ListHelper._build_schema_sub_resource_read(properties.remote_virtual_network) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_list_endpoint_services.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_list_endpoint_services.py deleted file mode 100644 index 38d04168597..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_list_endpoint_services.py +++ /dev/null @@ -1,172 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet list-endpoint-services", -) -class ListEndpointServices(AAZCommand): - """List which services support VNet service tunneling in a given region. - - To learn more about service endpoints visit https://learn.microsoft.com/azure/virtual-network/virtual-network-service-endpoints-configure#azure-cli. - - :example: List the endpoint services available for use in the West US region. - az network vnet list-endpoint-services -l westus -o table - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/locations/{}/virtualnetworkavailableendpointservices", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.AvailableEndpointServicesList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class AvailableEndpointServicesList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "location", self.ctx.args.location, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.id = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - return cls._schema_on_200 - - -class _ListEndpointServicesHelper: - """Helper class for ListEndpointServices""" - - -__all__ = ["ListEndpointServices"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_show.py deleted file mode 100644 index 819b0c38c80..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_show.py +++ /dev/null @@ -1,1551 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet show", -) -class Show(AAZCommand): - """Get the details of a virtual network. - - :example: Get details for MyVNet. - az network vnet show -g MyResourceGroup -n MyVNet - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworksGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworksGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - _ShowHelper._build_schema_address_space_read(properties.address_space) - properties.ddos_protection_plan = AAZObjectType( - serialized_name="ddosProtectionPlan", - ) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.enable_ddos_protection = AAZBoolType( - serialized_name="enableDdosProtection", - ) - properties.enable_vm_protection = AAZBoolType( - serialized_name="enableVmProtection", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - properties.virtual_network_peerings = AAZListType( - serialized_name="virtualNetworkPeerings", - ) - - ddos_protection_plan = cls._schema_on_200.properties.ddos_protection_plan - ddos_protection_plan.id = AAZStrType() - - dhcp_options = cls._schema_on_200.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = cls._schema_on_200.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = cls._schema_on_200.properties.subnets - subnets.Element = AAZObjectType() - _ShowHelper._build_schema_subnet_read(subnets.Element) - - virtual_network_peerings = cls._schema_on_200.properties.virtual_network_peerings - virtual_network_peerings.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.virtual_network_peerings.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.virtual_network_peerings.Element.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - _ShowHelper._build_schema_address_space_read(properties.remote_address_space) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - _ShowHelper._build_schema_sub_resource_read(properties.remote_virtual_network) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_update.py deleted file mode 100644 index 8cee2b6a115..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_update.py +++ /dev/null @@ -1,2101 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet update", -) -class Update(AAZCommand): - """Update a virtual network. - - :example: Update a virtual network with the IP address of a DNS server. - az network vnet update -g MyResourceGroup -n MyVNet --dns-servers 10.2.0.8 - - :example: Update a virtual network. - az network vnet update --address-prefixes 40.1.0.0/24 --name MyVNet --resource-group MyResourceGroup - - :example: Update a virtual network to delete DNS server. - az network vnet update -g MyResourceGroup -n MyVNet --dns-servers null - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.address_prefixes = AAZListArg( - options=["--address-prefixes"], - help="Space-separated list of IP address prefixes for the VNet.", - nullable=True, - ) - _args_schema.ddos_protection_plan = AAZStrArg( - options=["--ddos-protection-plan"], - help="Name or ID of a DDoS protection plan to associate with the VNet.", - nullable=True, - ) - _args_schema.dns_servers = AAZListArg( - options=["--dns-servers"], - help="Space-separated list of DNS server IP addresses.", - nullable=True, - ) - _args_schema.ddos_protection = AAZBoolArg( - options=["--ddos-protection"], - help="Control whether DDoS protection is enabled.", - nullable=True, - ) - _args_schema.vm_protection = AAZBoolArg( - options=["--vm-protection"], - help="Enable VM protection for all subnets in the VNet.", - nullable=True, - ) - - address_prefixes = cls._args_schema.address_prefixes - address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - dns_servers = cls._args_schema.dns_servers - dns_servers.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - return cls._args_schema - - _args_address_space_update = None - - @classmethod - def _build_args_address_space_update(cls, _schema): - if cls._args_address_space_update is not None: - _schema.address_prefixes = cls._args_address_space_update.address_prefixes - return - - cls._args_address_space_update = AAZObjectArg( - nullable=True, - ) - - address_space_update = cls._args_address_space_update - address_space_update.address_prefixes = AAZListArg( - options=["address-prefixes"], - help="A list of address blocks reserved for this virtual network in CIDR notation.", - nullable=True, - ) - - address_prefixes = cls._args_address_space_update.address_prefixes - address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - _schema.address_prefixes = cls._args_address_space_update.address_prefixes - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworksGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.VirtualNetworksCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworksGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworksCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressSpace", AAZObjectType) - properties.set_prop("ddosProtectionPlan", AAZObjectType) - properties.set_prop("dhcpOptions", AAZObjectType) - properties.set_prop("enableDdosProtection", AAZBoolType, ".ddos_protection") - properties.set_prop("enableVmProtection", AAZBoolType, ".vm_protection") - - address_space = _builder.get(".properties.addressSpace") - if address_space is not None: - address_space.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".properties.addressSpace.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - ddos_protection_plan = _builder.get(".properties.ddosProtectionPlan") - if ddos_protection_plan is not None: - ddos_protection_plan.set_prop("id", AAZStrType, ".ddos_protection_plan") - - dhcp_options = _builder.get(".properties.dhcpOptions") - if dhcp_options is not None: - dhcp_options.set_prop("dnsServers", AAZListType, ".dns_servers") - - dns_servers = _builder.get(".properties.dhcpOptions.dnsServers") - if dns_servers is not None: - dns_servers.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_address_space_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - _schema_virtual_network_read = None - - @classmethod - def _build_schema_virtual_network_read(cls, _schema): - if cls._schema_virtual_network_read is not None: - _schema.etag = cls._schema_virtual_network_read.etag - _schema.id = cls._schema_virtual_network_read.id - _schema.location = cls._schema_virtual_network_read.location - _schema.name = cls._schema_virtual_network_read.name - _schema.properties = cls._schema_virtual_network_read.properties - _schema.tags = cls._schema_virtual_network_read.tags - _schema.type = cls._schema_virtual_network_read.type - return - - cls._schema_virtual_network_read = _schema_virtual_network_read = AAZObjectType() - - virtual_network_read = _schema_virtual_network_read - virtual_network_read.etag = AAZStrType() - virtual_network_read.id = AAZStrType() - virtual_network_read.location = AAZStrType() - virtual_network_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_read.tags = AAZDictType() - virtual_network_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_read.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - cls._build_schema_address_space_read(properties.address_space) - properties.ddos_protection_plan = AAZObjectType( - serialized_name="ddosProtectionPlan", - ) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.enable_ddos_protection = AAZBoolType( - serialized_name="enableDdosProtection", - ) - properties.enable_vm_protection = AAZBoolType( - serialized_name="enableVmProtection", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - properties.virtual_network_peerings = AAZListType( - serialized_name="virtualNetworkPeerings", - ) - - ddos_protection_plan = _schema_virtual_network_read.properties.ddos_protection_plan - ddos_protection_plan.id = AAZStrType() - - dhcp_options = _schema_virtual_network_read.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = _schema_virtual_network_read.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = _schema_virtual_network_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - virtual_network_peerings = _schema_virtual_network_read.properties.virtual_network_peerings - virtual_network_peerings.Element = AAZObjectType() - - _element = _schema_virtual_network_read.properties.virtual_network_peerings.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_read.properties.virtual_network_peerings.Element.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - cls._build_schema_address_space_read(properties.remote_address_space) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - cls._build_schema_sub_resource_read(properties.remote_virtual_network) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - tags = _schema_virtual_network_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_read.etag - _schema.id = cls._schema_virtual_network_read.id - _schema.location = cls._schema_virtual_network_read.location - _schema.name = cls._schema_virtual_network_read.name - _schema.properties = cls._schema_virtual_network_read.properties - _schema.tags = cls._schema_virtual_network_read.tags - _schema.type = cls._schema_virtual_network_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_wait.py deleted file mode 100644 index f6ace04e929..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/_wait.py +++ /dev/null @@ -1,1547 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworksGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworksGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.address_space = AAZObjectType( - serialized_name="addressSpace", - ) - _WaitHelper._build_schema_address_space_read(properties.address_space) - properties.ddos_protection_plan = AAZObjectType( - serialized_name="ddosProtectionPlan", - ) - properties.dhcp_options = AAZObjectType( - serialized_name="dhcpOptions", - ) - properties.enable_ddos_protection = AAZBoolType( - serialized_name="enableDdosProtection", - ) - properties.enable_vm_protection = AAZBoolType( - serialized_name="enableVmProtection", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.subnets = AAZListType() - properties.virtual_network_peerings = AAZListType( - serialized_name="virtualNetworkPeerings", - ) - - ddos_protection_plan = cls._schema_on_200.properties.ddos_protection_plan - ddos_protection_plan.id = AAZStrType() - - dhcp_options = cls._schema_on_200.properties.dhcp_options - dhcp_options.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - - dns_servers = cls._schema_on_200.properties.dhcp_options.dns_servers - dns_servers.Element = AAZStrType() - - subnets = cls._schema_on_200.properties.subnets - subnets.Element = AAZObjectType() - _WaitHelper._build_schema_subnet_read(subnets.Element) - - virtual_network_peerings = cls._schema_on_200.properties.virtual_network_peerings - virtual_network_peerings.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.virtual_network_peerings.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.virtual_network_peerings.Element.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - _WaitHelper._build_schema_address_space_read(properties.remote_address_space) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - _WaitHelper._build_schema_sub_resource_read(properties.remote_virtual_network) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/__cmd_group.py deleted file mode 100644 index f9d713b5a5d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet peering", -) -class __CMDGroup(AAZCommandGroup): - """Manage peering connections between Azure Virtual Networks. - - To learn more about virtual network peering visit https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-manage-peering. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/__init__.py deleted file mode 100644 index db73033039b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_create.py deleted file mode 100644 index 09ced5f0207..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_create.py +++ /dev/null @@ -1,289 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet peering create", -) -class Create(AAZCommand): - """Create a virtual network peering connection. - - To successfully peer two virtual networks this command must be called twice with the values for --vnet-name and --remote-vnet reversed. - - :example: Create a peering connection between two virtual networks. - az network vnet peering create -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1 --remote-vnet MyVnet2Id --allow-vnet-access - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/virtualnetworkpeerings/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the VNet peering.", - required=True, - ) - _args_schema.allow_forwarded_traffic = AAZBoolArg( - options=["--allow-forwarded-traffic"], - help="Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network.", - default=False, - ) - _args_schema.allow_gateway_transit = AAZBoolArg( - options=["--allow-gateway-transit"], - help="If gateway links can be used in remote virtual networking to link to this virtual network.", - default=False, - ) - _args_schema.allow_vnet_access = AAZBoolArg( - options=["--allow-vnet-access"], - help="Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space.", - default=False, - ) - _args_schema.remote_vnet = AAZStrArg( - options=["--remote-vnet"], - help="Name or ID of the remote VNet.", - ) - _args_schema.use_remote_gateways = AAZBoolArg( - options=["--use-remote-gateways"], - help="Allows VNet to use the remote VNet's gateway. Remote VNet gateway must have --allow-gateway-transit enabled for remote peering. Only 1 peering can have this flag enabled. Cannot be set if the VNet already has a gateway.", - default=False, - ) - - # define Arg Group "Properties" - - # define Arg Group "VirtualNetworkPeeringParameters" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkPeeringsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkPeeringsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkPeeringName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("allowForwardedTraffic", AAZBoolType, ".allow_forwarded_traffic") - properties.set_prop("allowGatewayTransit", AAZBoolType, ".allow_gateway_transit") - properties.set_prop("allowVirtualNetworkAccess", AAZBoolType, ".allow_vnet_access") - properties.set_prop("remoteVirtualNetwork", AAZObjectType) - properties.set_prop("useRemoteGateways", AAZBoolType, ".use_remote_gateways") - - remote_virtual_network = _builder.get(".properties.remoteVirtualNetwork") - if remote_virtual_network is not None: - remote_virtual_network.set_prop("id", AAZStrType, ".remote_vnet") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.name = AAZStrType() - _schema_on_200_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - remote_address_space = cls._schema_on_200_201.properties.remote_address_space - remote_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200_201.properties.remote_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - remote_virtual_network = cls._schema_on_200_201.properties.remote_virtual_network - remote_virtual_network.id = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_delete.py deleted file mode 100644 index 99da973a42b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_delete.py +++ /dev/null @@ -1,172 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet peering delete", -) -class Delete(AAZCommand): - """Delete a peering. - - :example: Delete a virtual network peering connection. - az network vnet peering delete -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/virtualnetworkpeerings/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the VNet peering.", - required=True, - id_part="child_name_1", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkPeeringsDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class VirtualNetworkPeeringsDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkPeeringName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_list.py deleted file mode 100644 index ad47e27a026..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_list.py +++ /dev/null @@ -1,215 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet peering list", -) -class List(AAZCommand): - """List peerings. - - :example: List all peerings of a specified virtual network. - az network vnet peering list -g MyResourceGroup --vnet-name MyVnet1 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/virtualnetworkpeerings", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkPeeringsList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class VirtualNetworkPeeringsList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - remote_address_space = cls._schema_on_200.value.Element.properties.remote_address_space - remote_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.value.Element.properties.remote_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - remote_virtual_network = cls._schema_on_200.value.Element.properties.remote_virtual_network - remote_virtual_network.id = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_show.py deleted file mode 100644 index c79cc444f3a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_show.py +++ /dev/null @@ -1,217 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet peering show", -) -class Show(AAZCommand): - """Show details of a peering. - - :example: Show all details of the specified virtual network peering. - az network vnet peering show -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/virtualnetworkpeerings/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the VNet peering.", - required=True, - id_part="child_name_1", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkPeeringsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkPeeringsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkPeeringName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - remote_address_space = cls._schema_on_200.properties.remote_address_space - remote_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.remote_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - remote_virtual_network = cls._schema_on_200.properties.remote_virtual_network - remote_virtual_network.id = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_update.py deleted file mode 100644 index 96e28e05146..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_update.py +++ /dev/null @@ -1,408 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet peering update", -) -class Update(AAZCommand): - """Update a peering. - - :example: Change forwarded traffic configuration of a virtual network peering. - az network vnet peering update -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1 --set allowForwardedTraffic=true - - :example: Change virtual network access of a virtual network peering. - az network vnet peering update -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1 --set allowVirtualNetworkAccess=true - - :example: Change gateway transit property configuration of a virtual network peering. - az network vnet peering update -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1 --set allowGatewayTransit=true - - :example: Use remote gateways in virtual network peering. - az network vnet peering update -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1 --set useRemoteGateways=true - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/virtualnetworkpeerings/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the VNet peering.", - required=True, - id_part="child_name_1", - ) - - # define Arg Group "Properties" - - # define Arg Group "VirtualNetworkPeeringParameters" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkPeeringsGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.VirtualNetworkPeeringsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkPeeringsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkPeeringName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_peering_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkPeeringsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkPeeringName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_peering_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("remoteVirtualNetwork", AAZObjectType) - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_virtual_network_peering_read = None - - @classmethod - def _build_schema_virtual_network_peering_read(cls, _schema): - if cls._schema_virtual_network_peering_read is not None: - _schema.etag = cls._schema_virtual_network_peering_read.etag - _schema.id = cls._schema_virtual_network_peering_read.id - _schema.name = cls._schema_virtual_network_peering_read.name - _schema.properties = cls._schema_virtual_network_peering_read.properties - return - - cls._schema_virtual_network_peering_read = _schema_virtual_network_peering_read = AAZObjectType() - - virtual_network_peering_read = _schema_virtual_network_peering_read - virtual_network_peering_read.etag = AAZStrType() - virtual_network_peering_read.id = AAZStrType() - virtual_network_peering_read.name = AAZStrType() - virtual_network_peering_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_peering_read.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - remote_address_space = _schema_virtual_network_peering_read.properties.remote_address_space - remote_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_peering_read.properties.remote_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - remote_virtual_network = _schema_virtual_network_peering_read.properties.remote_virtual_network - remote_virtual_network.id = AAZStrType() - - _schema.etag = cls._schema_virtual_network_peering_read.etag - _schema.id = cls._schema_virtual_network_peering_read.id - _schema.name = cls._schema_virtual_network_peering_read.name - _schema.properties = cls._schema_virtual_network_peering_read.properties - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_wait.py deleted file mode 100644 index 7678202072d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/peering/_wait.py +++ /dev/null @@ -1,213 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet peering wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/virtualnetworkpeerings/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The name of the VNet peering.", - required=True, - id_part="child_name_1", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkPeeringsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkPeeringsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkPeeringName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties - properties.allow_forwarded_traffic = AAZBoolType( - serialized_name="allowForwardedTraffic", - ) - properties.allow_gateway_transit = AAZBoolType( - serialized_name="allowGatewayTransit", - ) - properties.allow_virtual_network_access = AAZBoolType( - serialized_name="allowVirtualNetworkAccess", - ) - properties.peering_state = AAZStrType( - serialized_name="peeringState", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.remote_address_space = AAZObjectType( - serialized_name="remoteAddressSpace", - ) - properties.remote_virtual_network = AAZObjectType( - serialized_name="remoteVirtualNetwork", - ) - properties.use_remote_gateways = AAZBoolType( - serialized_name="useRemoteGateways", - ) - - remote_address_space = cls._schema_on_200.properties.remote_address_space - remote_address_space.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.remote_address_space.address_prefixes - address_prefixes.Element = AAZStrType() - - remote_virtual_network = cls._schema_on_200.properties.remote_virtual_network - remote_virtual_network.id = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/__cmd_group.py deleted file mode 100644 index 7d97ad0f39f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet subnet", -) -class __CMDGroup(AAZCommandGroup): - """Manage subnets in an Azure Virtual Network. - - To learn more about subnets visit https://learn.microsoft.com/azure/virtual-network/virtual-network-manage-subnet. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/__init__.py deleted file mode 100644 index 699d5eaf622..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._list_available_delegations import * -from ._show import * -from ._update import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_create.py deleted file mode 100644 index 8d4a348bdf6..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_create.py +++ /dev/null @@ -1,1967 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet create", -) -class Create(AAZCommand): - """Create a subnet and associate an existing NSG and route table. - - :example: Create new subnet attached to an NSG with a custom route table. - az network vnet subnet create -g MyResourceGroup --vnet-name MyVnet -n MySubnet --address-prefixes 10.0.0.0/24 --network-security-group MyNsg --route-table MyRouteTable - - :example: Create new subnet attached to a NAT gateway. - az network vnet subnet create -n MySubnet --vnet-name MyVnet -g MyResourceGroup --nat-gateway MyNatGateway --address-prefixes "10.0.0.0/21" - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The subnet name.", - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - ) - _args_schema.address_prefix = AAZStrArg( - options=["--address-prefix"], - help="The address prefix for the subnet.", - ) - _args_schema.address_prefixes = AAZListArg( - options=["--address-prefixes"], - help="Space-separated list of address prefixes in CIDR format.", - ) - _args_schema.delegated_services = AAZListArg( - options=["--delegated-services"], - help="Space-separated list of services to whom the subnet should be delegated, e.g., `Microsoft.Sql/servers`.", - ) - _args_schema.network_security_group = AAZResourceIdArg( - options=["--nsg", "--network-security-group"], - help="Name or ID of a network security group (NSG).", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - _args_schema.route_table = AAZResourceIdArg( - options=["--route-table"], - help="Name or ID of a route table to associate with the subnet.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - _args_schema.policies = AAZListArg( - options=["--policies"], - help="An array of service endpoint policies.", - ) - _args_schema.endpoints = AAZListArg( - options=["--endpoints"], - help="An array of service endpoints.", - ) - - address_prefixes = cls._args_schema.address_prefixes - address_prefixes.Element = AAZStrArg() - - delegated_services = cls._args_schema.delegated_services - delegated_services.Element = AAZObjectArg() - - _element = cls._args_schema.delegated_services.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a subnet. This name can be used to access the resource.", - ) - _element.actions = AAZListArg( - options=["actions"], - help="Describes the actions permitted to the service upon delegation", - ) - _element.service_name = AAZStrArg( - options=["service-name"], - help="The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers).", - ) - - actions = cls._args_schema.delegated_services.Element.actions - actions.Element = AAZStrArg() - - policies = cls._args_schema.policies - policies.Element = AAZObjectArg() - - _element = cls._args_schema.policies.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.service_endpoint_policy_definitions = AAZListArg( - options=["service-endpoint-policy-definitions"], - help="A collection of service endpoint policy definitions of the service endpoint policy.", - ) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - service_endpoint_policy_definitions = cls._args_schema.policies.Element.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectArg() - - _element = cls._args_schema.policies.Element.service_endpoint_policy_definitions.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}/serviceEndpointPolicyDefinitions/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - _element.service = AAZStrArg( - options=["service"], - help="Service endpoint name.", - ) - _element.service_resources = AAZListArg( - options=["service-resources"], - help="A list of service resources.", - ) - - service_resources = cls._args_schema.policies.Element.service_endpoint_policy_definitions.Element.service_resources - service_resources.Element = AAZStrArg() - - tags = cls._args_schema.policies.Element.tags - tags.Element = AAZStrArg() - - endpoints = cls._args_schema.endpoints - endpoints.Element = AAZObjectArg() - - _element = cls._args_schema.endpoints.Element - _element.locations = AAZListArg( - options=["locations"], - help="A list of locations.", - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - ) - _element.service = AAZStrArg( - options=["service"], - help="The type of the endpoint service.", - ) - - locations = cls._args_schema.endpoints.Element.locations - locations.Element = AAZStrArg() - - # define Arg Group "NetworkSecurityGroup" - - # define Arg Group "Properties" - - # define Arg Group "RouteTable" - - # define Arg Group "SubnetParameters" - return cls._args_schema - - _args_application_security_group_create = None - - @classmethod - def _build_args_application_security_group_create(cls, _schema): - if cls._args_application_security_group_create is not None: - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - return - - cls._args_application_security_group_create = AAZObjectArg() - - application_security_group_create = cls._args_application_security_group_create - application_security_group_create.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_create.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_create.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - ) - - tags = cls._args_application_security_group_create.tags - tags.Element = AAZStrArg() - - _schema.id = cls._args_application_security_group_create.id - _schema.location = cls._args_application_security_group_create.location - _schema.tags = cls._args_application_security_group_create.tags - - _args_security_rule_create = None - - @classmethod - def _build_args_security_rule_create(cls, _schema): - if cls._args_security_rule_create is not None: - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - return - - cls._args_security_rule_create = AAZObjectArg() - - security_rule_create = cls._args_security_rule_create - security_rule_create.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - security_rule_create.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_create.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - ) - security_rule_create.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - ) - security_rule_create.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - ) - security_rule_create.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - ) - security_rule_create.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - ) - security_rule_create.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_create.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - ) - security_rule_create.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_create.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - ) - security_rule_create.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - ) - security_rule_create.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - ) - security_rule_create.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - ) - security_rule_create.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - ) - security_rule_create.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - ) - - destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg() - - destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - destination_port_ranges.Element = AAZStrArg() - - source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - source_address_prefixes.Element = AAZStrArg() - - source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg() - cls._build_args_application_security_group_create(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_create.source_port_ranges - source_port_ranges.Element = AAZStrArg() - - _schema.access = cls._args_security_rule_create.access - _schema.description = cls._args_security_rule_create.description - _schema.destination_address_prefix = cls._args_security_rule_create.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_create.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_create.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_create.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_create.destination_port_ranges - _schema.direction = cls._args_security_rule_create.direction - _schema.name = cls._args_security_rule_create.name - _schema.priority = cls._args_security_rule_create.priority - _schema.protocol = cls._args_security_rule_create.protocol - _schema.provisioning_state = cls._args_security_rule_create.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_create.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_create.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_create.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_create.source_port_range - _schema.source_port_ranges = cls._args_security_rule_create.source_port_ranges - - def _execute_operations(self): - self.pre_operations() - yield self.SubnetsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SubnetsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - properties.set_prop("delegations", AAZListType, ".delegated_services") - properties.set_prop("networkSecurityGroup", AAZObjectType) - properties.set_prop("routeTable", AAZObjectType) - properties.set_prop("serviceEndpointPolicies", AAZListType, ".policies") - properties.set_prop("serviceEndpoints", AAZListType, ".endpoints") - - address_prefixes = _builder.get(".properties.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - delegations = _builder.get(".properties.delegations") - if delegations is not None: - delegations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.delegations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.delegations[].properties") - if properties is not None: - properties.set_prop("actions", AAZListType, ".actions") - properties.set_prop("serviceName", AAZStrType, ".service_name") - - actions = _builder.get(".properties.delegations[].properties.actions") - if actions is not None: - actions.set_elements(AAZStrType, ".") - - network_security_group = _builder.get(".properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("id", AAZStrType, ".network_security_group") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("id", AAZStrType, ".route_table") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - service_endpoint_policies = _builder.get(".properties.serviceEndpointPolicies") - if service_endpoint_policies is not None: - service_endpoint_policies.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpointPolicies[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.serviceEndpointPolicies[].properties") - if properties is not None: - properties.set_prop("serviceEndpointPolicyDefinitions", AAZListType, ".service_endpoint_policy_definitions") - - service_endpoint_policy_definitions = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions") - if service_endpoint_policy_definitions is not None: - service_endpoint_policy_definitions.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties") - if properties is not None: - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("service", AAZStrType, ".service") - properties.set_prop("serviceResources", AAZListType, ".service_resources") - - service_resources = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties.serviceResources") - if service_resources is not None: - service_resources.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.serviceEndpointPolicies[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - service_endpoints = _builder.get(".properties.serviceEndpoints") - if service_endpoints is not None: - service_endpoints.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpoints[]") - if _elements is not None: - _elements.set_prop("locations", AAZListType, ".locations") - _elements.set_prop("provisioningState", AAZStrType, ".provisioning_state") - _elements.set_prop("service", AAZStrType, ".service") - - locations = _builder.get(".properties.serviceEndpoints[].locations") - if locations is not None: - locations.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_subnet_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - @classmethod - def _build_schema_application_security_group_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_create(cls, _builder): - if _builder is None: - return - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_create(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_create(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_delete.py deleted file mode 100644 index 296973318c6..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_delete.py +++ /dev/null @@ -1,172 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet delete", -) -class Delete(AAZCommand): - """Delete a subnet. - - :example: Delete a subnet. - az network vnet subnet delete --name MySubnet --resource-group MyResourceGroup --vnet-name MyVnet - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The subnet name.", - required=True, - id_part="child_name_1", - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.SubnetsDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class SubnetsDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_list.py deleted file mode 100644 index 3f132f0c62a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_list.py +++ /dev/null @@ -1,1433 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet list", -) -class List(AAZCommand): - """List the subnets in a virtual network. - - :example: List the subnets in a virtual network. - az network vnet subnet list -g MyResourceGroup --vnet-name MyVNet - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SubnetsList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class SubnetsList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - _ListHelper._build_schema_subnet_read(value.Element) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_list_available_delegations.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_list_available_delegations.py deleted file mode 100644 index ea06f691b3d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_list_available_delegations.py +++ /dev/null @@ -1,291 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet list-available-delegations", -) -class ListAvailableDelegations(AAZCommand): - """List the services available for subnet delegation. - - :example: Retrieve the service names for available delegations in the West US region. - az network vnet subnet list-available-delegations -l westus --query [].serviceName - - :example: List the services available for subnet delegation. (autogenerated) - az network vnet subnet list-available-delegations --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/locations/{}/availabledelegations", "2018-11-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/locations/{}/availabledelegations", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.location = AAZResourceLocationArg( - required=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.resource_group = AAZResourceGroupNameArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - condition_0 = has_value(self.ctx.args.location) and has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.args.location) and has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True - if condition_0: - self.AvailableResourceGroupDelegationsList(ctx=self.ctx)() - if condition_1: - self.AvailableDelegationsList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class AvailableResourceGroupDelegationsList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "location", self.ctx.args.location, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.actions = AAZListType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.service_name = AAZStrType( - serialized_name="serviceName", - ) - _element.type = AAZStrType() - - actions = cls._schema_on_200.value.Element.actions - actions.Element = AAZStrType() - - return cls._schema_on_200 - - class AvailableDelegationsList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableDelegations", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "location", self.ctx.args.location, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.actions = AAZListType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.service_name = AAZStrType( - serialized_name="serviceName", - ) - _element.type = AAZStrType() - - actions = cls._schema_on_200.value.Element.actions - actions.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListAvailableDelegationsHelper: - """Helper class for ListAvailableDelegations""" - - -__all__ = ["ListAvailableDelegations"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_show.py deleted file mode 100644 index 0e11442e227..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_show.py +++ /dev/null @@ -1,1442 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet show", -) -class Show(AAZCommand): - """Show details of a subnet. - - :example: Show the details of a subnet associated with a virtual network. - az network vnet subnet show -g MyResourceGroup -n MySubnet --vnet-name MyVNet - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The subnet name.", - required=True, - id_part="child_name_1", - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SubnetsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SubnetsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ShowHelper._build_schema_subnet_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_update.py deleted file mode 100644 index 2aba006d78b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_update.py +++ /dev/null @@ -1,2177 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet update", -) -class Update(AAZCommand): - """Update a subnet. - - :example: Associate a network security group to a subnet. - az network vnet subnet update -g MyResourceGroup -n MySubnet --vnet-name MyVNet --network-security-group MyNsg - - :example: Update subnet with NAT gateway. - az network vnet subnet update -n MySubnet --vnet-name MyVnet -g MyResourceGroup --nat-gateway MyNatGateway --address-prefixes "10.0.0.0/21" - - :example: Disable the private endpoint network policies - az network vnet subnet update -n MySubnet --vnet-name MyVnet -g MyResourceGroup --disable-private-endpoint-network-policies - - :example: Detach a network security group in a subnet. - az network vnet subnet update -g MyResourceGroup --vnet-name MyVNet -n MySubnet --nsg null - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The subnet name.", - required=True, - id_part="child_name_1", - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.address_prefix = AAZStrArg( - options=["--address-prefix"], - help="The address prefix for the subnet.", - nullable=True, - ) - _args_schema.address_prefixes = AAZListArg( - options=["--address-prefixes"], - help="Space-separated list of address prefixes in CIDR format.", - nullable=True, - ) - _args_schema.delegated_services = AAZListArg( - options=["--delegated-services"], - help="Space-separated list of services to whom the subnet should be delegated, e.g., `Microsoft.Sql/servers`.", - nullable=True, - ) - _args_schema.network_security_group = AAZResourceIdArg( - options=["--nsg", "--network-security-group"], - help="Name or ID of a network security group (NSG). Use null to detach it.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/networkSecurityGroups/{}", - ), - ) - _args_schema.route_table = AAZResourceIdArg( - options=["--route-table"], - help="Name or ID of a route table to associate with the subnet. Use null to detach it.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/routeTables/{}", - ), - ) - _args_schema.policies = AAZListArg( - options=["--policies"], - help="An array of service endpoint policies.", - nullable=True, - ) - _args_schema.endpoints = AAZListArg( - options=["--endpoints"], - help="An array of service endpoints.", - nullable=True, - ) - - address_prefixes = cls._args_schema.address_prefixes - address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - delegated_services = cls._args_schema.delegated_services - delegated_services.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.delegated_services.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a subnet. This name can be used to access the resource.", - nullable=True, - ) - _element.actions = AAZListArg( - options=["actions"], - help="Describes the actions permitted to the service upon delegation", - nullable=True, - ) - _element.service_name = AAZStrArg( - options=["service-name"], - help="The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers).", - nullable=True, - ) - - actions = cls._args_schema.delegated_services.Element.actions - actions.Element = AAZStrArg( - nullable=True, - ) - - policies = cls._args_schema.policies - policies.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.policies.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}", - ), - ) - _element.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _element.service_endpoint_policy_definitions = AAZListArg( - options=["service-endpoint-policy-definitions"], - help="A collection of service endpoint policy definitions of the service endpoint policy.", - nullable=True, - ) - _element.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - service_endpoint_policy_definitions = cls._args_schema.policies.Element.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.policies.Element.service_endpoint_policy_definitions.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/serviceEndpointPolicies/{}/serviceEndpointPolicyDefinitions/{}", - ), - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - _element.service = AAZStrArg( - options=["service"], - help="Service endpoint name.", - nullable=True, - ) - _element.service_resources = AAZListArg( - options=["service-resources"], - help="A list of service resources.", - nullable=True, - ) - - service_resources = cls._args_schema.policies.Element.service_endpoint_policy_definitions.Element.service_resources - service_resources.Element = AAZStrArg( - nullable=True, - ) - - tags = cls._args_schema.policies.Element.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - endpoints = cls._args_schema.endpoints - endpoints.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.endpoints.Element - _element.locations = AAZListArg( - options=["locations"], - help="A list of locations.", - nullable=True, - ) - _element.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the resource.", - nullable=True, - ) - _element.service = AAZStrArg( - options=["service"], - help="The type of the endpoint service.", - nullable=True, - ) - - locations = cls._args_schema.endpoints.Element.locations - locations.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "NetworkSecurityGroup" - - # define Arg Group "Properties" - - # define Arg Group "RouteTable" - - # define Arg Group "SubnetParameters" - return cls._args_schema - - _args_application_security_group_update = None - - @classmethod - def _build_args_application_security_group_update(cls, _schema): - if cls._args_application_security_group_update is not None: - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - return - - cls._args_application_security_group_update = AAZObjectArg( - nullable=True, - ) - - application_security_group_update = cls._args_application_security_group_update - application_security_group_update.id = AAZResourceIdArg( - options=["id"], - help="Resource ID.", - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Network/applicationSecurityGroups/{}", - ), - ) - application_security_group_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - application_security_group_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - tags = cls._args_application_security_group_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.id = cls._args_application_security_group_update.id - _schema.location = cls._args_application_security_group_update.location - _schema.tags = cls._args_application_security_group_update.tags - - _args_security_rule_update = None - - @classmethod - def _build_args_security_rule_update(cls, _schema): - if cls._args_security_rule_update is not None: - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - return - - cls._args_security_rule_update = AAZObjectArg( - nullable=True, - ) - - security_rule_update = cls._args_security_rule_update - security_rule_update.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - security_rule_update.access = AAZStrArg( - options=["access"], - help="The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'.", - enum={"Allow": "Allow", "Deny": "Deny"}, - ) - security_rule_update.description = AAZStrArg( - options=["description"], - help="A description for this rule. Restricted to 140 chars.", - nullable=True, - ) - security_rule_update.destination_address_prefix = AAZStrArg( - options=["destination-address-prefix"], - help="The destination address prefix. CIDR or destination IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.", - nullable=True, - ) - security_rule_update.destination_address_prefixes = AAZListArg( - options=["destination-address-prefixes"], - help="The destination address prefixes. CIDR or destination IP ranges.", - nullable=True, - ) - security_rule_update.destination_application_security_groups = AAZListArg( - options=["destination-application-security-groups"], - help="The application security group specified as destination.", - nullable=True, - ) - security_rule_update.destination_port_range = AAZStrArg( - options=["destination-port-range"], - help="The destination port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.destination_port_ranges = AAZListArg( - options=["destination-port-ranges"], - help="The destination port ranges.", - nullable=True, - ) - security_rule_update.direction = AAZStrArg( - options=["direction"], - help="The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'.", - enum={"Inbound": "Inbound", "Outbound": "Outbound"}, - ) - security_rule_update.priority = AAZIntArg( - options=["priority"], - help="The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.", - nullable=True, - ) - security_rule_update.protocol = AAZStrArg( - options=["protocol"], - help="Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'.", - enum={"*": "*", "Tcp": "Tcp", "Udp": "Udp"}, - ) - security_rule_update.provisioning_state = AAZStrArg( - options=["provisioning-state"], - help="The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.", - nullable=True, - ) - security_rule_update.source_address_prefix = AAZStrArg( - options=["source-address-prefix"], - help="The CIDR or source IP range. Asterisks '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. ", - nullable=True, - ) - security_rule_update.source_address_prefixes = AAZListArg( - options=["source-address-prefixes"], - help="The CIDR or source IP ranges.", - nullable=True, - ) - security_rule_update.source_application_security_groups = AAZListArg( - options=["source-application-security-groups"], - help="The application security group specified as source.", - nullable=True, - ) - security_rule_update.source_port_range = AAZStrArg( - options=["source-port-range"], - help="The source port or range. Integer or range between 0 and 65535. Asterisks '*' can also be used to match all ports.", - nullable=True, - ) - security_rule_update.source_port_ranges = AAZListArg( - options=["source-port-ranges"], - help="The source port ranges.", - nullable=True, - ) - - destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - destination_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(destination_application_security_groups.Element) - - destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - destination_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - source_address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - source_application_security_groups.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_application_security_group_update(source_application_security_groups.Element) - - source_port_ranges = cls._args_security_rule_update.source_port_ranges - source_port_ranges.Element = AAZStrArg( - nullable=True, - ) - - _schema.access = cls._args_security_rule_update.access - _schema.description = cls._args_security_rule_update.description - _schema.destination_address_prefix = cls._args_security_rule_update.destination_address_prefix - _schema.destination_address_prefixes = cls._args_security_rule_update.destination_address_prefixes - _schema.destination_application_security_groups = cls._args_security_rule_update.destination_application_security_groups - _schema.destination_port_range = cls._args_security_rule_update.destination_port_range - _schema.destination_port_ranges = cls._args_security_rule_update.destination_port_ranges - _schema.direction = cls._args_security_rule_update.direction - _schema.name = cls._args_security_rule_update.name - _schema.priority = cls._args_security_rule_update.priority - _schema.protocol = cls._args_security_rule_update.protocol - _schema.provisioning_state = cls._args_security_rule_update.provisioning_state - _schema.source_address_prefix = cls._args_security_rule_update.source_address_prefix - _schema.source_address_prefixes = cls._args_security_rule_update.source_address_prefixes - _schema.source_application_security_groups = cls._args_security_rule_update.source_application_security_groups - _schema.source_port_range = cls._args_security_rule_update.source_port_range - _schema.source_port_ranges = cls._args_security_rule_update.source_port_ranges - - def _execute_operations(self): - self.pre_operations() - self.SubnetsGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.SubnetsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class SubnetsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_subnet_read(cls._schema_on_200) - - return cls._schema_on_200 - - class SubnetsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_subnet_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("addressPrefix", AAZStrType, ".address_prefix") - properties.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - properties.set_prop("delegations", AAZListType, ".delegated_services") - properties.set_prop("networkSecurityGroup", AAZObjectType) - properties.set_prop("routeTable", AAZObjectType) - properties.set_prop("serviceEndpointPolicies", AAZListType, ".policies") - properties.set_prop("serviceEndpoints", AAZListType, ".endpoints") - - address_prefixes = _builder.get(".properties.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - delegations = _builder.get(".properties.delegations") - if delegations is not None: - delegations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.delegations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.delegations[].properties") - if properties is not None: - properties.set_prop("actions", AAZListType, ".actions") - properties.set_prop("serviceName", AAZStrType, ".service_name") - - actions = _builder.get(".properties.delegations[].properties.actions") - if actions is not None: - actions.set_elements(AAZStrType, ".") - - network_security_group = _builder.get(".properties.networkSecurityGroup") - if network_security_group is not None: - network_security_group.set_prop("id", AAZStrType, ".network_security_group") - network_security_group.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - route_table = _builder.get(".properties.routeTable") - if route_table is not None: - route_table.set_prop("id", AAZStrType, ".route_table") - route_table.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - service_endpoint_policies = _builder.get(".properties.serviceEndpointPolicies") - if service_endpoint_policies is not None: - service_endpoint_policies.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpointPolicies[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("location", AAZStrType, ".location") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - _elements.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties.serviceEndpointPolicies[].properties") - if properties is not None: - properties.set_prop("serviceEndpointPolicyDefinitions", AAZListType, ".service_endpoint_policy_definitions") - - service_endpoint_policy_definitions = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions") - if service_endpoint_policy_definitions is not None: - service_endpoint_policy_definitions.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties") - if properties is not None: - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("service", AAZStrType, ".service") - properties.set_prop("serviceResources", AAZListType, ".service_resources") - - service_resources = _builder.get(".properties.serviceEndpointPolicies[].properties.serviceEndpointPolicyDefinitions[].properties.serviceResources") - if service_resources is not None: - service_resources.set_elements(AAZStrType, ".") - - tags = _builder.get(".properties.serviceEndpointPolicies[].tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - service_endpoints = _builder.get(".properties.serviceEndpoints") - if service_endpoints is not None: - service_endpoints.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.serviceEndpoints[]") - if _elements is not None: - _elements.set_prop("locations", AAZListType, ".locations") - _elements.set_prop("provisioningState", AAZStrType, ".provisioning_state") - _elements.set_prop("service", AAZStrType, ".service") - - locations = _builder.get(".properties.serviceEndpoints[].locations") - if locations is not None: - locations.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_application_security_group_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("tags", AAZDictType, ".tags") - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_security_rule_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("access", AAZStrType, ".access", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("description", AAZStrType, ".description") - properties.set_prop("destinationAddressPrefix", AAZStrType, ".destination_address_prefix") - properties.set_prop("destinationAddressPrefixes", AAZListType, ".destination_address_prefixes") - properties.set_prop("destinationApplicationSecurityGroups", AAZListType, ".destination_application_security_groups") - properties.set_prop("destinationPortRange", AAZStrType, ".destination_port_range") - properties.set_prop("destinationPortRanges", AAZListType, ".destination_port_ranges") - properties.set_prop("direction", AAZStrType, ".direction", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("priority", AAZIntType, ".priority") - properties.set_prop("protocol", AAZStrType, ".protocol", typ_kwargs={"flags": {"required": True}}) - properties.set_prop("provisioningState", AAZStrType, ".provisioning_state") - properties.set_prop("sourceAddressPrefix", AAZStrType, ".source_address_prefix") - properties.set_prop("sourceAddressPrefixes", AAZListType, ".source_address_prefixes") - properties.set_prop("sourceApplicationSecurityGroups", AAZListType, ".source_application_security_groups") - properties.set_prop("sourcePortRange", AAZStrType, ".source_port_range") - properties.set_prop("sourcePortRanges", AAZListType, ".source_port_ranges") - - destination_address_prefixes = _builder.get(".properties.destinationAddressPrefixes") - if destination_address_prefixes is not None: - destination_address_prefixes.set_elements(AAZStrType, ".") - - destination_application_security_groups = _builder.get(".properties.destinationApplicationSecurityGroups") - if destination_application_security_groups is not None: - cls._build_schema_application_security_group_update(destination_application_security_groups.set_elements(AAZObjectType, ".")) - - destination_port_ranges = _builder.get(".properties.destinationPortRanges") - if destination_port_ranges is not None: - destination_port_ranges.set_elements(AAZStrType, ".") - - source_address_prefixes = _builder.get(".properties.sourceAddressPrefixes") - if source_address_prefixes is not None: - source_address_prefixes.set_elements(AAZStrType, ".") - - source_application_security_groups = _builder.get(".properties.sourceApplicationSecurityGroups") - if source_application_security_groups is not None: - cls._build_schema_application_security_group_update(source_application_security_groups.set_elements(AAZObjectType, ".")) - - source_port_ranges = _builder.get(".properties.sourcePortRanges") - if source_port_ranges is not None: - source_port_ranges.set_elements(AAZStrType, ".") - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_wait.py deleted file mode 100644 index c871395e42e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet/subnet/_wait.py +++ /dev/null @@ -1,1438 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet subnet wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworks/{}/subnets/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="The subnet name.", - required=True, - id_part="child_name_1", - ) - _args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - help="The virtual network (VNet) name.", - required=True, - id_part="name", - ) - _args_schema.expand = AAZStrArg( - options=["--expand"], - help="Expands referenced resources. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.SubnetsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class SubnetsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subnetName", self.ctx.args.name, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkName", self.ctx.args.vnet_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "$expand", self.ctx.args.expand, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_subnet_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_application_security_group_read = None - - @classmethod - def _build_schema_application_security_group_read(cls, _schema): - if cls._schema_application_security_group_read is not None: - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - return - - cls._schema_application_security_group_read = _schema_application_security_group_read = AAZObjectType() - - application_security_group_read = _schema_application_security_group_read - application_security_group_read.etag = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.id = AAZStrType() - application_security_group_read.location = AAZStrType() - application_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - application_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - application_security_group_read.tags = AAZDictType() - application_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_application_security_group_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - tags = _schema_application_security_group_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_application_security_group_read.etag - _schema.id = cls._schema_application_security_group_read.id - _schema.location = cls._schema_application_security_group_read.location - _schema.name = cls._schema_application_security_group_read.name - _schema.properties = cls._schema_application_security_group_read.properties - _schema.tags = cls._schema_application_security_group_read.tags - _schema.type = cls._schema_application_security_group_read.type - - _schema_ip_configuration_read = None - - @classmethod - def _build_schema_ip_configuration_read(cls, _schema): - if cls._schema_ip_configuration_read is not None: - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - return - - cls._schema_ip_configuration_read = _schema_ip_configuration_read = AAZObjectType() - - ip_configuration_read = _schema_ip_configuration_read - ip_configuration_read.etag = AAZStrType() - ip_configuration_read.id = AAZStrType() - ip_configuration_read.name = AAZStrType() - ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_ip_configuration_read.properties - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - _schema.etag = cls._schema_ip_configuration_read.etag - _schema.id = cls._schema_ip_configuration_read.id - _schema.name = cls._schema_ip_configuration_read.name - _schema.properties = cls._schema_ip_configuration_read.properties - - _schema_interface_endpoint_read = None - - @classmethod - def _build_schema_interface_endpoint_read(cls, _schema): - if cls._schema_interface_endpoint_read is not None: - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - return - - cls._schema_interface_endpoint_read = _schema_interface_endpoint_read = AAZObjectType() - - interface_endpoint_read = _schema_interface_endpoint_read - interface_endpoint_read.etag = AAZStrType() - interface_endpoint_read.id = AAZStrType() - interface_endpoint_read.location = AAZStrType() - interface_endpoint_read.name = AAZStrType( - flags={"read_only": True}, - ) - interface_endpoint_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - interface_endpoint_read.tags = AAZDictType() - interface_endpoint_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_interface_endpoint_read.properties - properties.endpoint_service = AAZObjectType( - serialized_name="endpointService", - ) - properties.fqdn = AAZStrType() - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.owner = AAZStrType( - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - endpoint_service = _schema_interface_endpoint_read.properties.endpoint_service - endpoint_service.id = AAZStrType() - - network_interfaces = _schema_interface_endpoint_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - tags = _schema_interface_endpoint_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_interface_endpoint_read.etag - _schema.id = cls._schema_interface_endpoint_read.id - _schema.location = cls._schema_interface_endpoint_read.location - _schema.name = cls._schema_interface_endpoint_read.name - _schema.properties = cls._schema_interface_endpoint_read.properties - _schema.tags = cls._schema_interface_endpoint_read.tags - _schema.type = cls._schema_interface_endpoint_read.type - - _schema_network_interface_ip_configuration_read = None - - @classmethod - def _build_schema_network_interface_ip_configuration_read(cls, _schema): - if cls._schema_network_interface_ip_configuration_read is not None: - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - return - - cls._schema_network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read = AAZObjectType() - - network_interface_ip_configuration_read = _schema_network_interface_ip_configuration_read - network_interface_ip_configuration_read.etag = AAZStrType() - network_interface_ip_configuration_read.id = AAZStrType() - network_interface_ip_configuration_read.name = AAZStrType() - network_interface_ip_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties - properties.application_gateway_backend_address_pools = AAZListType( - serialized_name="applicationGatewayBackendAddressPools", - ) - properties.application_security_groups = AAZListType( - serialized_name="applicationSecurityGroups", - ) - properties.load_balancer_backend_address_pools = AAZListType( - serialized_name="loadBalancerBackendAddressPools", - ) - properties.load_balancer_inbound_nat_rules = AAZListType( - serialized_name="loadBalancerInboundNatRules", - ) - properties.primary = AAZBoolType() - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_address_version = AAZStrType( - serialized_name="privateIPAddressVersion", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - properties.virtual_network_taps = AAZListType( - serialized_name="virtualNetworkTaps", - ) - - application_gateway_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools - application_gateway_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType() - - properties = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties - properties.backend_addresses = AAZListType( - serialized_name="backendAddresses", - ) - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_addresses = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses - backend_addresses.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_addresses.Element - _element.fqdn = AAZStrType() - _element.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.application_gateway_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - application_security_groups = _schema_network_interface_ip_configuration_read.properties.application_security_groups - application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(application_security_groups.Element) - - load_balancer_backend_address_pools = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools - load_balancer_backend_address_pools.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties - properties.backend_ip_configurations = AAZListType( - serialized_name="backendIPConfigurations", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rule = AAZObjectType( - serialized_name="outboundRule", - ) - cls._build_schema_sub_resource_read(properties.outbound_rule) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - backend_ip_configurations = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.backend_ip_configurations - backend_ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(backend_ip_configurations.Element) - - load_balancing_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_backend_address_pools.Element.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - load_balancer_inbound_nat_rules = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules - load_balancer_inbound_nat_rules.Element = AAZObjectType() - - _element = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_network_interface_ip_configuration_read.properties.load_balancer_inbound_nat_rules.Element.properties - properties.backend_ip_configuration = AAZObjectType( - serialized_name="backendIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.backend_ip_configuration) - properties.backend_port = AAZIntType( - serialized_name="backendPort", - ) - properties.enable_floating_ip = AAZBoolType( - serialized_name="enableFloatingIP", - ) - properties.enable_tcp_reset = AAZBoolType( - serialized_name="enableTcpReset", - ) - properties.frontend_ip_configuration = AAZObjectType( - serialized_name="frontendIPConfiguration", - ) - cls._build_schema_sub_resource_read(properties.frontend_ip_configuration) - properties.frontend_port = AAZIntType( - serialized_name="frontendPort", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.protocol = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - virtual_network_taps = _schema_network_interface_ip_configuration_read.properties.virtual_network_taps - virtual_network_taps.Element = AAZObjectType() - cls._build_schema_virtual_network_tap_read(virtual_network_taps.Element) - - _schema.etag = cls._schema_network_interface_ip_configuration_read.etag - _schema.id = cls._schema_network_interface_ip_configuration_read.id - _schema.name = cls._schema_network_interface_ip_configuration_read.name - _schema.properties = cls._schema_network_interface_ip_configuration_read.properties - - _schema_network_interface_tap_configuration_read = None - - @classmethod - def _build_schema_network_interface_tap_configuration_read(cls, _schema): - if cls._schema_network_interface_tap_configuration_read is not None: - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - return - - cls._schema_network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read = AAZObjectType() - - network_interface_tap_configuration_read = _schema_network_interface_tap_configuration_read - network_interface_tap_configuration_read.etag = AAZStrType() - network_interface_tap_configuration_read.id = AAZStrType() - network_interface_tap_configuration_read.name = AAZStrType() - network_interface_tap_configuration_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_tap_configuration_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_tap_configuration_read.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.virtual_network_tap = AAZObjectType( - serialized_name="virtualNetworkTap", - ) - cls._build_schema_virtual_network_tap_read(properties.virtual_network_tap) - - _schema.etag = cls._schema_network_interface_tap_configuration_read.etag - _schema.id = cls._schema_network_interface_tap_configuration_read.id - _schema.name = cls._schema_network_interface_tap_configuration_read.name - _schema.properties = cls._schema_network_interface_tap_configuration_read.properties - _schema.type = cls._schema_network_interface_tap_configuration_read.type - - _schema_network_interface_read = None - - @classmethod - def _build_schema_network_interface_read(cls, _schema): - if cls._schema_network_interface_read is not None: - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - return - - cls._schema_network_interface_read = _schema_network_interface_read = AAZObjectType() - - network_interface_read = _schema_network_interface_read - network_interface_read.etag = AAZStrType() - network_interface_read.id = AAZStrType() - network_interface_read.location = AAZStrType() - network_interface_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_interface_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_interface_read.tags = AAZDictType() - network_interface_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_interface_read.properties - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.enable_accelerated_networking = AAZBoolType( - serialized_name="enableAcceleratedNetworking", - ) - properties.enable_ip_forwarding = AAZBoolType( - serialized_name="enableIPForwarding", - ) - properties.hosted_workloads = AAZListType( - serialized_name="hostedWorkloads", - flags={"read_only": True}, - ) - properties.interface_endpoint = AAZObjectType( - serialized_name="interfaceEndpoint", - ) - cls._build_schema_interface_endpoint_read(properties.interface_endpoint) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.mac_address = AAZStrType( - serialized_name="macAddress", - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.primary = AAZBoolType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.tap_configurations = AAZListType( - serialized_name="tapConfigurations", - ) - properties.virtual_machine = AAZObjectType( - serialized_name="virtualMachine", - ) - cls._build_schema_sub_resource_read(properties.virtual_machine) - - dns_settings = _schema_network_interface_read.properties.dns_settings - dns_settings.applied_dns_servers = AAZListType( - serialized_name="appliedDnsServers", - ) - dns_settings.dns_servers = AAZListType( - serialized_name="dnsServers", - ) - dns_settings.internal_dns_name_label = AAZStrType( - serialized_name="internalDnsNameLabel", - ) - dns_settings.internal_domain_name_suffix = AAZStrType( - serialized_name="internalDomainNameSuffix", - ) - dns_settings.internal_fqdn = AAZStrType( - serialized_name="internalFqdn", - ) - - applied_dns_servers = _schema_network_interface_read.properties.dns_settings.applied_dns_servers - applied_dns_servers.Element = AAZStrType() - - dns_servers = _schema_network_interface_read.properties.dns_settings.dns_servers - dns_servers.Element = AAZStrType() - - hosted_workloads = _schema_network_interface_read.properties.hosted_workloads - hosted_workloads.Element = AAZStrType() - - ip_configurations = _schema_network_interface_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_ip_configuration_read(ip_configurations.Element) - - tap_configurations = _schema_network_interface_read.properties.tap_configurations - tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(tap_configurations.Element) - - tags = _schema_network_interface_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_network_interface_read.etag - _schema.id = cls._schema_network_interface_read.id - _schema.location = cls._schema_network_interface_read.location - _schema.name = cls._schema_network_interface_read.name - _schema.properties = cls._schema_network_interface_read.properties - _schema.tags = cls._schema_network_interface_read.tags - _schema.type = cls._schema_network_interface_read.type - - _schema_network_security_group_read = None - - @classmethod - def _build_schema_network_security_group_read(cls, _schema): - if cls._schema_network_security_group_read is not None: - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - return - - cls._schema_network_security_group_read = _schema_network_security_group_read = AAZObjectType() - - network_security_group_read = _schema_network_security_group_read - network_security_group_read.id = AAZStrType() - network_security_group_read.location = AAZStrType() - network_security_group_read.name = AAZStrType( - flags={"read_only": True}, - ) - network_security_group_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - network_security_group_read.tags = AAZDictType() - network_security_group_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_network_security_group_read.properties - properties.default_security_rules = AAZListType( - serialized_name="defaultSecurityRules", - ) - properties.network_interfaces = AAZListType( - serialized_name="networkInterfaces", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.security_rules = AAZListType( - serialized_name="securityRules", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - default_security_rules = _schema_network_security_group_read.properties.default_security_rules - default_security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(default_security_rules.Element) - - network_interfaces = _schema_network_security_group_read.properties.network_interfaces - network_interfaces.Element = AAZObjectType() - cls._build_schema_network_interface_read(network_interfaces.Element) - - security_rules = _schema_network_security_group_read.properties.security_rules - security_rules.Element = AAZObjectType() - cls._build_schema_security_rule_read(security_rules.Element) - - subnets = _schema_network_security_group_read.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_network_security_group_read.tags - tags.Element = AAZStrType() - - _schema.id = cls._schema_network_security_group_read.id - _schema.location = cls._schema_network_security_group_read.location - _schema.name = cls._schema_network_security_group_read.name - _schema.properties = cls._schema_network_security_group_read.properties - _schema.tags = cls._schema_network_security_group_read.tags - _schema.type = cls._schema_network_security_group_read.type - - _schema_public_ip_address_read = None - - @classmethod - def _build_schema_public_ip_address_read(cls, _schema): - if cls._schema_public_ip_address_read is not None: - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - return - - cls._schema_public_ip_address_read = _schema_public_ip_address_read = AAZObjectType() - - public_ip_address_read = _schema_public_ip_address_read - public_ip_address_read.etag = AAZStrType() - public_ip_address_read.id = AAZStrType() - public_ip_address_read.location = AAZStrType() - public_ip_address_read.name = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - public_ip_address_read.sku = AAZObjectType() - public_ip_address_read.tags = AAZDictType() - public_ip_address_read.type = AAZStrType( - flags={"read_only": True}, - ) - public_ip_address_read.zones = AAZListType() - - properties = _schema_public_ip_address_read.properties - properties.ddos_settings = AAZObjectType( - serialized_name="ddosSettings", - ) - properties.dns_settings = AAZObjectType( - serialized_name="dnsSettings", - ) - properties.idle_timeout_in_minutes = AAZIntType( - serialized_name="idleTimeoutInMinutes", - ) - properties.ip_address = AAZStrType( - serialized_name="ipAddress", - ) - properties.ip_configuration = AAZObjectType( - serialized_name="ipConfiguration", - ) - cls._build_schema_ip_configuration_read(properties.ip_configuration) - properties.ip_tags = AAZListType( - serialized_name="ipTags", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address_version = AAZStrType( - serialized_name="publicIPAddressVersion", - ) - properties.public_ip_allocation_method = AAZStrType( - serialized_name="publicIPAllocationMethod", - ) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - ddos_settings = _schema_public_ip_address_read.properties.ddos_settings - ddos_settings.ddos_custom_policy = AAZObjectType( - serialized_name="ddosCustomPolicy", - ) - cls._build_schema_sub_resource_read(ddos_settings.ddos_custom_policy) - ddos_settings.protection_coverage = AAZStrType( - serialized_name="protectionCoverage", - ) - - dns_settings = _schema_public_ip_address_read.properties.dns_settings - dns_settings.domain_name_label = AAZStrType( - serialized_name="domainNameLabel", - ) - dns_settings.fqdn = AAZStrType() - dns_settings.reverse_fqdn = AAZStrType( - serialized_name="reverseFqdn", - ) - - ip_tags = _schema_public_ip_address_read.properties.ip_tags - ip_tags.Element = AAZObjectType() - - _element = _schema_public_ip_address_read.properties.ip_tags.Element - _element.ip_tag_type = AAZStrType( - serialized_name="ipTagType", - ) - _element.tag = AAZStrType() - - sku = _schema_public_ip_address_read.sku - sku.name = AAZStrType() - - tags = _schema_public_ip_address_read.tags - tags.Element = AAZStrType() - - zones = _schema_public_ip_address_read.zones - zones.Element = AAZStrType() - - _schema.etag = cls._schema_public_ip_address_read.etag - _schema.id = cls._schema_public_ip_address_read.id - _schema.location = cls._schema_public_ip_address_read.location - _schema.name = cls._schema_public_ip_address_read.name - _schema.properties = cls._schema_public_ip_address_read.properties - _schema.sku = cls._schema_public_ip_address_read.sku - _schema.tags = cls._schema_public_ip_address_read.tags - _schema.type = cls._schema_public_ip_address_read.type - _schema.zones = cls._schema_public_ip_address_read.zones - - _schema_security_rule_read = None - - @classmethod - def _build_schema_security_rule_read(cls, _schema): - if cls._schema_security_rule_read is not None: - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - return - - cls._schema_security_rule_read = _schema_security_rule_read = AAZObjectType() - - security_rule_read = _schema_security_rule_read - security_rule_read.id = AAZStrType() - security_rule_read.name = AAZStrType() - security_rule_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_security_rule_read.properties - properties.access = AAZStrType( - flags={"required": True}, - ) - properties.description = AAZStrType() - properties.destination_address_prefix = AAZStrType( - serialized_name="destinationAddressPrefix", - ) - properties.destination_address_prefixes = AAZListType( - serialized_name="destinationAddressPrefixes", - ) - properties.destination_application_security_groups = AAZListType( - serialized_name="destinationApplicationSecurityGroups", - ) - properties.destination_port_range = AAZStrType( - serialized_name="destinationPortRange", - ) - properties.destination_port_ranges = AAZListType( - serialized_name="destinationPortRanges", - ) - properties.direction = AAZStrType( - flags={"required": True}, - ) - properties.priority = AAZIntType() - properties.protocol = AAZStrType( - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.source_address_prefix = AAZStrType( - serialized_name="sourceAddressPrefix", - ) - properties.source_address_prefixes = AAZListType( - serialized_name="sourceAddressPrefixes", - ) - properties.source_application_security_groups = AAZListType( - serialized_name="sourceApplicationSecurityGroups", - ) - properties.source_port_range = AAZStrType( - serialized_name="sourcePortRange", - ) - properties.source_port_ranges = AAZListType( - serialized_name="sourcePortRanges", - ) - - destination_address_prefixes = _schema_security_rule_read.properties.destination_address_prefixes - destination_address_prefixes.Element = AAZStrType() - - destination_application_security_groups = _schema_security_rule_read.properties.destination_application_security_groups - destination_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(destination_application_security_groups.Element) - - destination_port_ranges = _schema_security_rule_read.properties.destination_port_ranges - destination_port_ranges.Element = AAZStrType() - - source_address_prefixes = _schema_security_rule_read.properties.source_address_prefixes - source_address_prefixes.Element = AAZStrType() - - source_application_security_groups = _schema_security_rule_read.properties.source_application_security_groups - source_application_security_groups.Element = AAZObjectType() - cls._build_schema_application_security_group_read(source_application_security_groups.Element) - - source_port_ranges = _schema_security_rule_read.properties.source_port_ranges - source_port_ranges.Element = AAZStrType() - - _schema.id = cls._schema_security_rule_read.id - _schema.name = cls._schema_security_rule_read.name - _schema.properties = cls._schema_security_rule_read.properties - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_subnet_read = None - - @classmethod - def _build_schema_subnet_read(cls, _schema): - if cls._schema_subnet_read is not None: - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - return - - cls._schema_subnet_read = _schema_subnet_read = AAZObjectType() - - subnet_read = _schema_subnet_read - subnet_read.etag = AAZStrType() - subnet_read.id = AAZStrType() - subnet_read.name = AAZStrType() - subnet_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - properties.delegations = AAZListType() - properties.interface_endpoints = AAZListType( - serialized_name="interfaceEndpoints", - flags={"read_only": True}, - ) - properties.ip_configuration_profiles = AAZListType( - serialized_name="ipConfigurationProfiles", - flags={"read_only": True}, - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - flags={"read_only": True}, - ) - properties.network_security_group = AAZObjectType( - serialized_name="networkSecurityGroup", - ) - cls._build_schema_network_security_group_read(properties.network_security_group) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.purpose = AAZStrType( - flags={"read_only": True}, - ) - properties.resource_navigation_links = AAZListType( - serialized_name="resourceNavigationLinks", - ) - properties.route_table = AAZObjectType( - serialized_name="routeTable", - ) - properties.service_association_links = AAZListType( - serialized_name="serviceAssociationLinks", - ) - properties.service_endpoint_policies = AAZListType( - serialized_name="serviceEndpointPolicies", - ) - properties.service_endpoints = AAZListType( - serialized_name="serviceEndpoints", - ) - - address_prefixes = _schema_subnet_read.properties.address_prefixes - address_prefixes.Element = AAZStrType() - - delegations = _schema_subnet_read.properties.delegations - delegations.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.delegations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.delegations.Element.properties - properties.actions = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_name = AAZStrType( - serialized_name="serviceName", - ) - - actions = _schema_subnet_read.properties.delegations.Element.properties.actions - actions.Element = AAZStrType() - - interface_endpoints = _schema_subnet_read.properties.interface_endpoints - interface_endpoints.Element = AAZObjectType() - cls._build_schema_interface_endpoint_read(interface_endpoints.Element) - - ip_configuration_profiles = _schema_subnet_read.properties.ip_configuration_profiles - ip_configuration_profiles.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.ip_configuration_profiles.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.ip_configuration_profiles.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - ip_configurations = _schema_subnet_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - cls._build_schema_ip_configuration_read(ip_configurations.Element) - - resource_navigation_links = _schema_subnet_read.properties.resource_navigation_links - resource_navigation_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.resource_navigation_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.resource_navigation_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - route_table = _schema_subnet_read.properties.route_table - route_table.etag = AAZStrType() - route_table.id = AAZStrType() - route_table.location = AAZStrType() - route_table.name = AAZStrType( - flags={"read_only": True}, - ) - route_table.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - route_table.tags = AAZDictType() - route_table.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties - properties.disable_bgp_route_propagation = AAZBoolType( - serialized_name="disableBgpRoutePropagation", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.routes = AAZListType() - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - routes = _schema_subnet_read.properties.route_table.properties.routes - routes.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.route_table.properties.routes.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.route_table.properties.routes.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.next_hop_ip_address = AAZStrType( - serialized_name="nextHopIpAddress", - ) - properties.next_hop_type = AAZStrType( - serialized_name="nextHopType", - flags={"required": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - - subnets = _schema_subnet_read.properties.route_table.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.route_table.tags - tags.Element = AAZStrType() - - service_association_links = _schema_subnet_read.properties.service_association_links - service_association_links.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_association_links.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_association_links.Element.properties - properties.link = AAZStrType() - properties.linked_resource_type = AAZStrType( - serialized_name="linkedResourceType", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - service_endpoint_policies = _schema_subnet_read.properties.service_endpoint_policies - service_endpoint_policies.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - properties.service_endpoint_policy_definitions = AAZListType( - serialized_name="serviceEndpointPolicyDefinitions", - ) - properties.subnets = AAZListType( - flags={"read_only": True}, - ) - - service_endpoint_policy_definitions = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions - service_endpoint_policy_definitions.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties - properties.description = AAZStrType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service = AAZStrType() - properties.service_resources = AAZListType( - serialized_name="serviceResources", - ) - - service_resources = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.service_endpoint_policy_definitions.Element.properties.service_resources - service_resources.Element = AAZStrType() - - subnets = _schema_subnet_read.properties.service_endpoint_policies.Element.properties.subnets - subnets.Element = AAZObjectType() - cls._build_schema_subnet_read(subnets.Element) - - tags = _schema_subnet_read.properties.service_endpoint_policies.Element.tags - tags.Element = AAZStrType() - - service_endpoints = _schema_subnet_read.properties.service_endpoints - service_endpoints.Element = AAZObjectType() - - _element = _schema_subnet_read.properties.service_endpoints.Element - _element.locations = AAZListType() - _element.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - _element.service = AAZStrType() - - locations = _schema_subnet_read.properties.service_endpoints.Element.locations - locations.Element = AAZStrType() - - _schema.etag = cls._schema_subnet_read.etag - _schema.id = cls._schema_subnet_read.id - _schema.name = cls._schema_subnet_read.name - _schema.properties = cls._schema_subnet_read.properties - - _schema_virtual_network_tap_read = None - - @classmethod - def _build_schema_virtual_network_tap_read(cls, _schema): - if cls._schema_virtual_network_tap_read is not None: - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - return - - cls._schema_virtual_network_tap_read = _schema_virtual_network_tap_read = AAZObjectType() - - virtual_network_tap_read = _schema_virtual_network_tap_read - virtual_network_tap_read.etag = AAZStrType() - virtual_network_tap_read.id = AAZStrType() - virtual_network_tap_read.location = AAZStrType() - virtual_network_tap_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_tap_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - virtual_network_tap_read.tags = AAZDictType() - virtual_network_tap_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_tap_read.properties - properties.destination_load_balancer_front_end_ip_configuration = AAZObjectType( - serialized_name="destinationLoadBalancerFrontEndIPConfiguration", - ) - properties.destination_network_interface_ip_configuration = AAZObjectType( - serialized_name="destinationNetworkInterfaceIPConfiguration", - ) - cls._build_schema_network_interface_ip_configuration_read(properties.destination_network_interface_ip_configuration) - properties.destination_port = AAZIntType( - serialized_name="destinationPort", - ) - properties.network_interface_tap_configurations = AAZListType( - serialized_name="networkInterfaceTapConfigurations", - flags={"read_only": True}, - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - flags={"read_only": True}, - ) - - destination_load_balancer_front_end_ip_configuration = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration - destination_load_balancer_front_end_ip_configuration.etag = AAZStrType() - destination_load_balancer_front_end_ip_configuration.id = AAZStrType() - destination_load_balancer_front_end_ip_configuration.name = AAZStrType() - destination_load_balancer_front_end_ip_configuration.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - destination_load_balancer_front_end_ip_configuration.zones = AAZListType() - - properties = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties - properties.inbound_nat_pools = AAZListType( - serialized_name="inboundNatPools", - flags={"read_only": True}, - ) - properties.inbound_nat_rules = AAZListType( - serialized_name="inboundNatRules", - flags={"read_only": True}, - ) - properties.load_balancing_rules = AAZListType( - serialized_name="loadBalancingRules", - flags={"read_only": True}, - ) - properties.outbound_rules = AAZListType( - serialized_name="outboundRules", - flags={"read_only": True}, - ) - properties.private_ip_address = AAZStrType( - serialized_name="privateIPAddress", - ) - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_public_ip_address_read(properties.public_ip_address) - properties.public_ip_prefix = AAZObjectType( - serialized_name="publicIPPrefix", - ) - cls._build_schema_sub_resource_read(properties.public_ip_prefix) - properties.subnet = AAZObjectType() - cls._build_schema_subnet_read(properties.subnet) - - inbound_nat_pools = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_pools - inbound_nat_pools.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_pools.Element) - - inbound_nat_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.inbound_nat_rules - inbound_nat_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(inbound_nat_rules.Element) - - load_balancing_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.load_balancing_rules - load_balancing_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(load_balancing_rules.Element) - - outbound_rules = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.properties.outbound_rules - outbound_rules.Element = AAZObjectType() - cls._build_schema_sub_resource_read(outbound_rules.Element) - - zones = _schema_virtual_network_tap_read.properties.destination_load_balancer_front_end_ip_configuration.zones - zones.Element = AAZStrType() - - network_interface_tap_configurations = _schema_virtual_network_tap_read.properties.network_interface_tap_configurations - network_interface_tap_configurations.Element = AAZObjectType() - cls._build_schema_network_interface_tap_configuration_read(network_interface_tap_configurations.Element) - - tags = _schema_virtual_network_tap_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_tap_read.etag - _schema.id = cls._schema_virtual_network_tap_read.id - _schema.location = cls._schema_virtual_network_tap_read.location - _schema.name = cls._schema_virtual_network_tap_read.name - _schema.properties = cls._schema_virtual_network_tap_read.properties - _schema.tags = cls._schema_virtual_network_tap_read.tags - _schema.type = cls._schema_virtual_network_tap_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/__cmd_group.py deleted file mode 100644 index 06369b9d587..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet-gateway", -) -class __CMDGroup(AAZCommandGroup): - """Use an Azure Virtual Network Gateway to establish secure, cross-premises connectivity. - - To learn more about Azure Virtual Network Gateways, visit https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-cli. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/__init__.py deleted file mode 100644 index a7bf2b4140b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._list_advertised_routes import * -from ._list_bgp_peer_status import * -from ._list_learned_routes import * -from ._reset import * -from ._show import * -from ._show_supported_devices import * -from ._update import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_create.py deleted file mode 100644 index 71eb28e793f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_create.py +++ /dev/null @@ -1,680 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway create", -) -class Create(AAZCommand): - """Create a virtual network gateway. - - :example: Create a basic virtual network gateway for site-to-site connectivity. - az network vnet-gateway create -g MyResourceGroup -n MyVnetGateway --public-ip-address MyGatewayIp --vnet MyVnet --gateway-type Vpn --sku VpnGw1 --vpn-type RouteBased --no-wait - - :example: Create a basic virtual network gateway that provides point-to-site connectivity with a RADIUS secret that matches what is configured on a RADIUS server. - az network vnet-gateway create -g MyResourceGroup -n MyVnetGateway --public-ip-address MyGatewayIp --vnet MyVnet --gateway-type Vpn --sku VpnGw1 --vpn-type RouteBased --address-prefixes 40.1.0.0/24 --client-protocol IkeV2 SSTP --radius-secret 111_aaa --radius-server 30.1.1.15 --vpn-gateway-generation Generation1 - - :example: Create a basic virtual network gateway with multi authentication - az network vnet-gateway create -g MyResourceGroup -n MyVnetGateway --public-ip-address MyGatewayIp --vnet MyVnet --gateway-type Vpn --sku VpnGw1 --vpn-type RouteBased --address-prefixes 40.1.0.0/24 --client-protocol OpenVPN --radius-secret 111_aaa --radius-server 30.1.1.15 --aad-issuer https://sts.windows.net/00000-000000-00000-0000-000/ --aad-tenant https://login.microsoftonline.com/000 --aad-audience 0000-000 --root-cert-name root-cert --root-cert-data "root-cert.cer" --vpn-auth-type AAD Certificate Radius - - :example: Create a virtual network gateway. - az network vnet-gateway create --gateway-type Vpn --location westus2 --name MyVnetGateway --no-wait --public-ip-addresses myVGPublicIPAddress --resource-group MyResourceGroup --sku Basic --vnet MyVnet --vpn-type PolicyBased - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - ) - _args_schema.location = AAZResourceLocationArg( - help="Location. Values from: `az account list-locations`. You can configure the default location using `az configure --defaults location=`.", - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - _args_schema.gateway_default_site = AAZStrArg( - options=["--gateway-default-site"], - help="Name or ID of a local network gateway representing a local network site with default routes.", - ) - _args_schema.gateway_type = AAZStrArg( - options=["--gateway-type"], - help="The gateway type.", - default="Vpn", - enum={"ExpressRoute": "ExpressRoute", "Vpn": "Vpn"}, - ) - _args_schema.ip_configurations = AAZListArg( - options=["--ip-configurations"], - help="IP configurations for virtual network gateway.", - ) - _args_schema.sku = AAZStrArg( - options=["--sku"], - help="VNet gateway SKU.", - default="Basic", - enum={"Basic": "Basic", "ErGw1AZ": "ErGw1AZ", "ErGw2AZ": "ErGw2AZ", "ErGw3AZ": "ErGw3AZ", "HighPerformance": "HighPerformance", "Standard": "Standard", "UltraPerformance": "UltraPerformance", "VpnGw1": "VpnGw1", "VpnGw1AZ": "VpnGw1AZ", "VpnGw2": "VpnGw2", "VpnGw2AZ": "VpnGw2AZ", "VpnGw3": "VpnGw3", "VpnGw3AZ": "VpnGw3AZ"}, - ) - _args_schema.vpn_type = AAZStrArg( - options=["--vpn-type"], - help="VPN routing type.", - default="RouteBased", - enum={"PolicyBased": "PolicyBased", "RouteBased": "RouteBased"}, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", - ) - - ip_configurations = cls._args_schema.ip_configurations - ip_configurations.Element = AAZObjectArg() - - _element = cls._args_schema.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP address allocation method.", - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.public_ip_address = AAZStrArg( - options=["public-ip-address"], - help="The reference to the public IP resource.", - ) - _element.subnet = AAZStrArg( - options=["subnet"], - help="test", - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg() - - # define Arg Group "BGP Peering" - - _args_schema = cls._args_schema - _args_schema.asn = AAZIntArg( - options=["--asn"], - arg_group="BGP Peering", - help="Autonomous System Number to use for the BGP settings.", - ) - _args_schema.bgp_peering_address = AAZStrArg( - options=["--bgp-peering-address"], - arg_group="BGP Peering", - help="IP address to use for BGP peering.", - ) - _args_schema.peer_weight = AAZIntArg( - options=["--peer-weight"], - arg_group="BGP Peering", - help="Weight (0-100) added to routes learned through BGP peering.", - ) - _args_schema.enable_bgp = AAZBoolArg( - options=["--enable-bgp"], - arg_group="BGP Peering", - help="Enable BGP (Border Gateway Protocol).", - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.active = AAZBoolArg( - options=["--active"], - arg_group="Properties", - help="ActiveActive flag.", - ) - _args_schema.sku_tier = AAZStrArg( - options=["--sku-tier"], - arg_group="Properties", - help="Gateway SKU tier.", - enum={"Basic": "Basic", "ErGw1AZ": "ErGw1AZ", "ErGw2AZ": "ErGw2AZ", "ErGw3AZ": "ErGw3AZ", "HighPerformance": "HighPerformance", "Standard": "Standard", "UltraPerformance": "UltraPerformance", "VpnGw1": "VpnGw1", "VpnGw1AZ": "VpnGw1AZ", "VpnGw2": "VpnGw2", "VpnGw2AZ": "VpnGw2AZ", "VpnGw3": "VpnGw3", "VpnGw3AZ": "VpnGw3AZ"}, - ) - - # define Arg Group "Root Cert Authentication" - - _args_schema = cls._args_schema - _args_schema.vpn_client_root_certificates = AAZListArg( - options=["--vpn-client-root-certificates"], - arg_group="Root Cert Authentication", - help="VpnClientRootCertificate for virtual network gateway.", - ) - - vpn_client_root_certificates = cls._args_schema.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectArg() - - _element = cls._args_schema.vpn_client_root_certificates.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - ) - _element.public_cert_data = AAZStrArg( - options=["public-cert-data"], - help="The certificate public data.", - required=True, - ) - - # define Arg Group "Sku" - - # define Arg Group "VPN Client" - - _args_schema = cls._args_schema - _args_schema.radius_server = AAZStrArg( - options=["--radius-server"], - arg_group="VPN Client", - help="Radius server address to connect to.", - ) - _args_schema.radius_secret = AAZStrArg( - options=["--radius-secret"], - arg_group="VPN Client", - help="Radius secret to use for authentication.", - ) - _args_schema.address_prefixes = AAZListArg( - options=["--address-prefixes"], - singular_options=["--address-prefix"], - arg_group="VPN Client", - help="Space-separated list of CIDR prefixes representing the address space for the P2S Vpnclient.", - ) - _args_schema.client_protocol = AAZListArg( - options=["--client-protocol"], - arg_group="VPN Client", - help="Protocols to use for connecting. Allowed values: IkeV2, OpenVPN, SSTP.", - ) - - address_prefixes = cls._args_schema.address_prefixes - address_prefixes.Element = AAZStrArg() - - client_protocol = cls._args_schema.client_protocol - client_protocol.Element = AAZStrArg( - enum={"IkeV2": "IkeV2", "OpenVPN": "OpenVPN", "SSTP": "SSTP"}, - ) - - # define Arg Group "VpnClientConfiguration" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("activeActive", AAZBoolType, ".active") - properties.set_prop("bgpSettings", AAZObjectType) - properties.set_prop("enableBgp", AAZBoolType, ".enable_bgp") - properties.set_prop("gatewayDefaultSite", AAZObjectType) - properties.set_prop("gatewayType", AAZStrType, ".gateway_type") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("sku", AAZObjectType) - properties.set_prop("vpnClientConfiguration", AAZObjectType) - properties.set_prop("vpnType", AAZStrType, ".vpn_type") - - bgp_settings = _builder.get(".properties.bgpSettings") - if bgp_settings is not None: - bgp_settings.set_prop("asn", AAZIntType, ".asn") - bgp_settings.set_prop("bgpPeeringAddress", AAZStrType, ".bgp_peering_address") - bgp_settings.set_prop("peerWeight", AAZIntType, ".peer_weight") - - gateway_default_site = _builder.get(".properties.gatewayDefaultSite") - if gateway_default_site is not None: - gateway_default_site.set_prop("id", AAZStrType, ".gateway_default_site") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - properties.set_prop("publicIPAddress", AAZObjectType) - properties.set_prop("subnet", AAZObjectType) - - public_ip_address = _builder.get(".properties.ipConfigurations[].properties.publicIPAddress") - if public_ip_address is not None: - public_ip_address.set_prop("id", AAZStrType, ".public_ip_address") - - subnet = _builder.get(".properties.ipConfigurations[].properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - - sku = _builder.get(".properties.sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".sku") - sku.set_prop("tier", AAZStrType, ".sku_tier") - - vpn_client_configuration = _builder.get(".properties.vpnClientConfiguration") - if vpn_client_configuration is not None: - vpn_client_configuration.set_prop("radiusServerAddress", AAZStrType, ".radius_server") - vpn_client_configuration.set_prop("radiusServerSecret", AAZStrType, ".radius_secret") - vpn_client_configuration.set_prop("vpnClientAddressPool", AAZObjectType) - vpn_client_configuration.set_prop("vpnClientProtocols", AAZListType, ".client_protocol") - vpn_client_configuration.set_prop("vpnClientRootCertificates", AAZListType, ".vpn_client_root_certificates") - - vpn_client_address_pool = _builder.get(".properties.vpnClientConfiguration.vpnClientAddressPool") - if vpn_client_address_pool is not None: - vpn_client_address_pool.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".properties.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - vpn_client_protocols = _builder.get(".properties.vpnClientConfiguration.vpnClientProtocols") - if vpn_client_protocols is not None: - vpn_client_protocols.set_elements(AAZStrType, ".") - - vpn_client_root_certificates = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates") - if vpn_client_root_certificates is not None: - vpn_client_root_certificates.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - - properties = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[].properties") - if properties is not None: - properties.set_prop("publicCertData", AAZStrType, ".public_cert_data", typ_kwargs={"flags": {"required": True}}) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - - _schema_on_200_201 = cls._schema_on_200_201 - _schema_on_200_201.etag = AAZStrType() - _schema_on_200_201.id = AAZStrType() - _schema_on_200_201.location = AAZStrType() - _schema_on_200_201.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200_201.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200_201.tags = AAZDictType() - _schema_on_200_201.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200_201.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - _CreateHelper._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = cls._schema_on_200_201.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = cls._schema_on_200_201.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _CreateHelper._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _CreateHelper._build_schema_sub_resource_read(properties.subnet) - - sku = cls._schema_on_200_201.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = cls._schema_on_200_201.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_ipsec_policies = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - vpn_client_protocols = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = cls._schema_on_200_201.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = cls._schema_on_200_201.tags - tags.Element = AAZStrType() - - return cls._schema_on_200_201 - - -class _CreateHelper: - """Helper class for Create""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_delete.py deleted file mode 100644 index f3af90464a2..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_delete.py +++ /dev/null @@ -1,164 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway delete", -) -class Delete(AAZCommand): - """Delete a virtual network gateway. - - In order to delete a Virtual Network Gateway, you must first delete ALL Connection objects in Azure that are connected to the Gateway. After deleting the Gateway, proceed to delete other resources now not in use. For more information, follow the order of instructions on this page: https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-delete-vnet-gateway-portal - - :example: Delete a virtual network gateway. - az network vnet-gateway delete -g MyResourceGroup -n MyVnetGateway - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class VirtualNetworkGatewaysDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_list.py deleted file mode 100644 index 32eb44f084e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_list.py +++ /dev/null @@ -1,380 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway list", -) -class List(AAZCommand): - """List virtual network gateways. - - :example: List virtual network gateways in a resource group. - az network vnet-gateway list -g MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class VirtualNetworkGatewaysList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - _ListHelper._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = cls._schema_on_200.value.Element.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = cls._schema_on_200.value.Element.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _ListHelper._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(properties.subnet) - - sku = cls._schema_on_200.value.Element.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = cls._schema_on_200.value.Element.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_ipsec_policies = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - vpn_client_protocols = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_list_advertised_routes.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_list_advertised_routes.py deleted file mode 100644 index 7353c0afca8..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_list_advertised_routes.py +++ /dev/null @@ -1,221 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway list-advertised-routes", -) -class ListAdvertisedRoutes(AAZCommand): - """List the routes of a virtual network gateway advertised to the specified peer. - - :example: List the routes of a virtual network gateway advertised to the specified peer. - az network vnet-gateway list-advertised-routes -g MyResourceGroup -n MyVnetGateway --peer 23.10.10.9 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/getadvertisedroutes", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - _args_schema.peer = AAZStrArg( - options=["--peer"], - help="The IP address of the peer.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysGetAdvertisedRoutes(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysGetAdvertisedRoutes(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "peer", self.ctx.args.peer, - required=True, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.as_path = AAZStrType( - serialized_name="asPath", - flags={"read_only": True}, - ) - _element.local_address = AAZStrType( - serialized_name="localAddress", - flags={"read_only": True}, - ) - _element.network = AAZStrType( - flags={"read_only": True}, - ) - _element.next_hop = AAZStrType( - serialized_name="nextHop", - flags={"read_only": True}, - ) - _element.origin = AAZStrType( - flags={"read_only": True}, - ) - _element.source_peer = AAZStrType( - serialized_name="sourcePeer", - flags={"read_only": True}, - ) - _element.weight = AAZIntType( - flags={"read_only": True}, - ) - - return cls._schema_on_200 - - -class _ListAdvertisedRoutesHelper: - """Helper class for ListAdvertisedRoutes""" - - -__all__ = ["ListAdvertisedRoutes"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_list_bgp_peer_status.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_list_bgp_peer_status.py deleted file mode 100644 index e6b9b09a721..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_list_bgp_peer_status.py +++ /dev/null @@ -1,223 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway list-bgp-peer-status", -) -class ListBgpPeerStatus(AAZCommand): - """Retrieve the status of BGP peers. - - :example: Retrieve the status of a BGP peer. - az network vnet-gateway list-bgp-peer-status -g MyResourceGroup -n MyVnetGateway --peer 23.10.10.9 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/getbgppeerstatus", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - _args_schema.peer = AAZStrArg( - options=["--peer"], - help="The IP address of the peer to retrieve the status of. Default value is None.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysGetBgpPeerStatus(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysGetBgpPeerStatus(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "peer", self.ctx.args.peer, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.asn = AAZIntType( - flags={"read_only": True}, - ) - _element.connected_duration = AAZStrType( - serialized_name="connectedDuration", - flags={"read_only": True}, - ) - _element.local_address = AAZStrType( - serialized_name="localAddress", - flags={"read_only": True}, - ) - _element.messages_received = AAZIntType( - serialized_name="messagesReceived", - flags={"read_only": True}, - ) - _element.messages_sent = AAZIntType( - serialized_name="messagesSent", - flags={"read_only": True}, - ) - _element.neighbor = AAZStrType( - flags={"read_only": True}, - ) - _element.routes_received = AAZIntType( - serialized_name="routesReceived", - flags={"read_only": True}, - ) - _element.state = AAZStrType( - flags={"read_only": True}, - ) - - return cls._schema_on_200 - - -class _ListBgpPeerStatusHelper: - """Helper class for ListBgpPeerStatus""" - - -__all__ = ["ListBgpPeerStatus"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_list_learned_routes.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_list_learned_routes.py deleted file mode 100644 index 57f6d44b875..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_list_learned_routes.py +++ /dev/null @@ -1,212 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway list-learned-routes", -) -class ListLearnedRoutes(AAZCommand): - """This operation retrieves a list of routes the virtual network gateway has learned, including routes learned from BGP peers. - - :example: Retrieve a list of learned routes. - az network vnet-gateway list-learned-routes -g MyResourceGroup -n MyVnetGateway - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/getlearnedroutes", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysGetLearnedRoutes(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysGetLearnedRoutes(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.as_path = AAZStrType( - serialized_name="asPath", - flags={"read_only": True}, - ) - _element.local_address = AAZStrType( - serialized_name="localAddress", - flags={"read_only": True}, - ) - _element.network = AAZStrType( - flags={"read_only": True}, - ) - _element.next_hop = AAZStrType( - serialized_name="nextHop", - flags={"read_only": True}, - ) - _element.origin = AAZStrType( - flags={"read_only": True}, - ) - _element.source_peer = AAZStrType( - serialized_name="sourcePeer", - flags={"read_only": True}, - ) - _element.weight = AAZIntType( - flags={"read_only": True}, - ) - - return cls._schema_on_200 - - -class _ListLearnedRoutesHelper: - """Helper class for ListLearnedRoutes""" - - -__all__ = ["ListLearnedRoutes"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_reset.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_reset.py deleted file mode 100644 index a24d84d8ba8..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_reset.py +++ /dev/null @@ -1,408 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway reset", -) -class Reset(AAZCommand): - """Reset a virtual network gateway. - - :example: Reset a virtual network gateway. - az network vnet-gateway reset -g MyResourceGroup -n MyVnetGateway - - :example: Reset a virtual network gateway with Active-Active feature enabled. - az network vnet-gateway reset -g MyResourceGroup -n MyVnetGateway --gateway-vip MyGatewayIP - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/reset", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - _args_schema.gateway_vip = AAZStrArg( - options=["--gateway-vip"], - help="Virtual network gateway vip address supplied to the begin reset of the active-active feature enabled gateway.", - default="None", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysReset(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysReset(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "gatewayVip", self.ctx.args.gateway_vip, - ), - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - _ResetHelper._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = cls._schema_on_200.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = cls._schema_on_200.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _ResetHelper._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _ResetHelper._build_schema_sub_resource_read(properties.subnet) - - sku = cls._schema_on_200.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = cls._schema_on_200.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_ipsec_policies = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - vpn_client_protocols = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ResetHelper: - """Helper class for Reset""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["Reset"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_show.py deleted file mode 100644 index ad34a953cb5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_show.py +++ /dev/null @@ -1,380 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway show", -) -class Show(AAZCommand): - """Get the details of a virtual network gateway. - - :example: Get the details of a virtual network gateway. - az network vnet-gateway show -g MyResourceGroup -n MyVnetGateway - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - _ShowHelper._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = cls._schema_on_200.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = cls._schema_on_200.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _ShowHelper._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(properties.subnet) - - sku = cls._schema_on_200.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = cls._schema_on_200.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_ipsec_policies = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - vpn_client_protocols = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_show_supported_devices.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_show_supported_devices.py deleted file mode 100644 index bd7bdb817c8..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_show_supported_devices.py +++ /dev/null @@ -1,163 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway show-supported-devices", - is_preview=True, -) -class ShowSupportedDevices(AAZCommand): - """Get a xml format representation for supported vpn devices. - - :example: Get a xml format representation for supported vpn devices. - az network vnet-gateway show-supported-devices -g MyResourceGroup -n MyVnetGateway - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/supportedvpndevices", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysSupportedVpnDevices(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysSupportedVpnDevices(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZStrType() - - return cls._schema_on_200 - - -class _ShowSupportedDevicesHelper: - """Helper class for ShowSupportedDevices""" - - -__all__ = ["ShowSupportedDevices"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_update.py deleted file mode 100644 index a4b198e3cd4..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_update.py +++ /dev/null @@ -1,929 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway update", -) -class Update(AAZCommand): - """Update a virtual network gateway. - - :example: Change the SKU of a virtual network gateway. - az network vnet-gateway update -g MyResourceGroup -n MyVnetGateway --sku VpnGw2 - - :example: Update a virtual network gateway. - az network vnet-gateway update --address-prefixes 40.1.0.0/24 --client-protocol IkeV2 --name MyVnetGateway --resource-group MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - _args_schema.gateway_default_site = AAZStrArg( - options=["--gateway-default-site"], - help="Name or ID of a local network gateway representing a local network site with default routes.", - nullable=True, - ) - _args_schema.gateway_type = AAZStrArg( - options=["--gateway-type"], - help="The gateway type.", - nullable=True, - enum={"ExpressRoute": "ExpressRoute", "Vpn": "Vpn"}, - ) - _args_schema.sku = AAZStrArg( - options=["--sku"], - help="VNet gateway SKU.", - nullable=True, - enum={"Basic": "Basic", "ErGw1AZ": "ErGw1AZ", "ErGw2AZ": "ErGw2AZ", "ErGw3AZ": "ErGw3AZ", "HighPerformance": "HighPerformance", "Standard": "Standard", "UltraPerformance": "UltraPerformance", "VpnGw1": "VpnGw1", "VpnGw1AZ": "VpnGw1AZ", "VpnGw2": "VpnGw2", "VpnGw2AZ": "VpnGw2AZ", "VpnGw3": "VpnGw3", "VpnGw3AZ": "VpnGw3AZ"}, - ) - _args_schema.vpn_type = AAZStrArg( - options=["--vpn-type"], - help="VPN routing type.", - nullable=True, - enum={"PolicyBased": "PolicyBased", "RouteBased": "RouteBased"}, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "BGP Peering" - - _args_schema = cls._args_schema - _args_schema.asn = AAZIntArg( - options=["--asn"], - arg_group="BGP Peering", - help="Autonomous System Number to use for the BGP settings.", - nullable=True, - ) - _args_schema.bgp_peering_address = AAZStrArg( - options=["--bgp-peering-address"], - arg_group="BGP Peering", - help="IP address to use for BGP peering.", - nullable=True, - ) - _args_schema.peer_weight = AAZIntArg( - options=["--peer-weight"], - arg_group="BGP Peering", - help="Weight (0-100) added to routes learned through BGP peering.", - nullable=True, - ) - _args_schema.enable_bgp = AAZBoolArg( - options=["--enable-bgp"], - arg_group="BGP Peering", - help="Enable BGP (Border Gateway Protocol).", - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.active = AAZBoolArg( - options=["--active"], - arg_group="Properties", - help="ActiveActive flag.", - nullable=True, - ) - _args_schema.ip_configurations = AAZListArg( - options=["--ip-configurations"], - arg_group="Properties", - help="IP configurations for virtual network gateway.", - nullable=True, - ) - _args_schema.sku_tier = AAZStrArg( - options=["--sku-tier"], - arg_group="Properties", - help="Gateway SKU tier.", - nullable=True, - enum={"Basic": "Basic", "ErGw1AZ": "ErGw1AZ", "ErGw2AZ": "ErGw2AZ", "ErGw3AZ": "ErGw3AZ", "HighPerformance": "HighPerformance", "Standard": "Standard", "UltraPerformance": "UltraPerformance", "VpnGw1": "VpnGw1", "VpnGw1AZ": "VpnGw1AZ", "VpnGw2": "VpnGw2", "VpnGw2AZ": "VpnGw2AZ", "VpnGw3": "VpnGw3", "VpnGw3AZ": "VpnGw3AZ"}, - ) - - ip_configurations = cls._args_schema.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP address allocation method.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference to the public IP resource.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.public_ip_address) - _element.subnet = AAZStrArg( - options=["subnet"], - help="test", - nullable=True, - ) - - # define Arg Group "Root Cert Authentication" - - _args_schema = cls._args_schema - _args_schema.vpn_client_root_certificates = AAZListArg( - options=["--vpn-client-root-certificates"], - arg_group="Root Cert Authentication", - help="VpnClientRootCertificate for virtual network gateway.", - nullable=True, - ) - - vpn_client_root_certificates = cls._args_schema.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.vpn_client_root_certificates.Element - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.public_cert_data = AAZStrArg( - options=["public-cert-data"], - help="The certificate public data.", - ) - - # define Arg Group "Sku" - - # define Arg Group "VPN Client" - - _args_schema = cls._args_schema - _args_schema.radius_server = AAZStrArg( - options=["--radius-server"], - arg_group="VPN Client", - help="Radius server address to connect to.", - nullable=True, - ) - _args_schema.radius_secret = AAZStrArg( - options=["--radius-secret"], - arg_group="VPN Client", - help="Radius secret to use for authentication.", - nullable=True, - ) - _args_schema.address_prefixes = AAZListArg( - options=["--address-prefixes"], - singular_options=["--address-prefix"], - arg_group="VPN Client", - help="Space-separated list of CIDR prefixes representing the address space for the P2S Vpnclient.", - nullable=True, - ) - _args_schema.client_protocol = AAZListArg( - options=["--client-protocol"], - arg_group="VPN Client", - help="Protocols to use for connecting. Allowed values: IkeV2, OpenVPN, SSTP.", - nullable=True, - ) - - address_prefixes = cls._args_schema.address_prefixes - address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - client_protocol = cls._args_schema.client_protocol - client_protocol.Element = AAZStrArg( - nullable=True, - enum={"IkeV2": "IkeV2", "OpenVPN": "OpenVPN", "SSTP": "SSTP"}, - ) - - # define Arg Group "VpnClientConfiguration" - - _args_schema = cls._args_schema - _args_schema.vpn_client_ipsec_policies = AAZListArg( - options=["--vpn-client-ipsec-policies"], - arg_group="VpnClientConfiguration", - help="VpnClientIpsecPolicies for virtual network gateway P2S client.", - nullable=True, - ) - - vpn_client_ipsec_policies = cls._args_schema.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrArg( - options=["dh-group"], - help="The DH Group used in IKE Phase 1 for initial SA.", - enum={"DHGroup1": "DHGroup1", "DHGroup14": "DHGroup14", "DHGroup2": "DHGroup2", "DHGroup2048": "DHGroup2048", "DHGroup24": "DHGroup24", "ECP256": "ECP256", "ECP384": "ECP384", "None": "None"}, - ) - _element.ike_encryption = AAZStrArg( - options=["ike-encryption"], - help="The IKE encryption algorithm (IKE phase 2).", - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3", "GCMAES128": "GCMAES128", "GCMAES256": "GCMAES256"}, - ) - _element.ike_integrity = AAZStrArg( - options=["ike-integrity"], - help="The IKE integrity algorithm (IKE phase 2).", - enum={"GCMAES128": "GCMAES128", "GCMAES256": "GCMAES256", "MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256", "SHA384": "SHA384"}, - ) - _element.ipsec_encryption = AAZStrArg( - options=["ipsec-encryption"], - help="The IPSec encryption algorithm (IKE phase 1).", - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3", "GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "None": "None"}, - ) - _element.ipsec_integrity = AAZStrArg( - options=["ipsec-integrity"], - help="The IPSec integrity algorithm (IKE phase 1).", - enum={"GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256"}, - ) - _element.pfs_group = AAZStrArg( - options=["pfs-group"], - help="The Pfs Group used in IKE Phase 2 for new child SA.", - enum={"ECP256": "ECP256", "ECP384": "ECP384", "None": "None", "PFS1": "PFS1", "PFS14": "PFS14", "PFS2": "PFS2", "PFS2048": "PFS2048", "PFS24": "PFS24", "PFSMM": "PFSMM"}, - ) - _element.sa_data_size_kilobytes = AAZIntArg( - options=["sa-data-size-kilobytes"], - help="The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel.", - ) - _element.sa_life_time_seconds = AAZIntArg( - options=["sa-life-time-seconds"], - help="The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel.", - ) - return cls._args_schema - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("activeActive", AAZBoolType, ".active") - properties.set_prop("bgpSettings", AAZObjectType) - properties.set_prop("enableBgp", AAZBoolType, ".enable_bgp") - properties.set_prop("gatewayDefaultSite", AAZObjectType) - properties.set_prop("gatewayType", AAZStrType, ".gateway_type") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("sku", AAZObjectType) - properties.set_prop("vpnClientConfiguration", AAZObjectType) - properties.set_prop("vpnType", AAZStrType, ".vpn_type") - - bgp_settings = _builder.get(".properties.bgpSettings") - if bgp_settings is not None: - bgp_settings.set_prop("asn", AAZIntType, ".asn") - bgp_settings.set_prop("bgpPeeringAddress", AAZStrType, ".bgp_peering_address") - bgp_settings.set_prop("peerWeight", AAZIntType, ".peer_weight") - - gateway_default_site = _builder.get(".properties.gatewayDefaultSite") - if gateway_default_site is not None: - gateway_default_site.set_prop("id", AAZStrType, ".gateway_default_site") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - _UpdateHelper._build_schema_sub_resource_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - properties.set_prop("subnet", AAZObjectType) - - subnet = _builder.get(".properties.ipConfigurations[].properties.subnet") - if subnet is not None: - subnet.set_prop("id", AAZStrType, ".subnet") - - sku = _builder.get(".properties.sku") - if sku is not None: - sku.set_prop("name", AAZStrType, ".sku") - sku.set_prop("tier", AAZStrType, ".sku_tier") - - vpn_client_configuration = _builder.get(".properties.vpnClientConfiguration") - if vpn_client_configuration is not None: - vpn_client_configuration.set_prop("radiusServerAddress", AAZStrType, ".radius_server") - vpn_client_configuration.set_prop("radiusServerSecret", AAZStrType, ".radius_secret") - vpn_client_configuration.set_prop("vpnClientAddressPool", AAZObjectType) - vpn_client_configuration.set_prop("vpnClientIpsecPolicies", AAZListType, ".vpn_client_ipsec_policies") - vpn_client_configuration.set_prop("vpnClientProtocols", AAZListType, ".client_protocol") - vpn_client_configuration.set_prop("vpnClientRootCertificates", AAZListType, ".vpn_client_root_certificates") - - vpn_client_address_pool = _builder.get(".properties.vpnClientConfiguration.vpnClientAddressPool") - if vpn_client_address_pool is not None: - vpn_client_address_pool.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".properties.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - vpn_client_ipsec_policies = _builder.get(".properties.vpnClientConfiguration.vpnClientIpsecPolicies") - if vpn_client_ipsec_policies is not None: - vpn_client_ipsec_policies.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.vpnClientConfiguration.vpnClientIpsecPolicies[]") - if _elements is not None: - _elements.set_prop("dhGroup", AAZStrType, ".dh_group", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("ikeEncryption", AAZStrType, ".ike_encryption", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("ikeIntegrity", AAZStrType, ".ike_integrity", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("ipsecEncryption", AAZStrType, ".ipsec_encryption", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("ipsecIntegrity", AAZStrType, ".ipsec_integrity", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("pfsGroup", AAZStrType, ".pfs_group", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("saDataSizeKilobytes", AAZIntType, ".sa_data_size_kilobytes", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("saLifeTimeSeconds", AAZIntType, ".sa_life_time_seconds", typ_kwargs={"flags": {"required": True}}) - - vpn_client_protocols = _builder.get(".properties.vpnClientConfiguration.vpnClientProtocols") - if vpn_client_protocols is not None: - vpn_client_protocols.set_elements(AAZStrType, ".") - - vpn_client_root_certificates = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates") - if vpn_client_root_certificates is not None: - vpn_client_root_certificates.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[]") - if _elements is not None: - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - - properties = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[].properties") - if properties is not None: - properties.set_prop("publicCertData", AAZStrType, ".public_cert_data", typ_kwargs={"flags": {"required": True}}) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_wait.py deleted file mode 100644 index 70d3add1f92..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/_wait.py +++ /dev/null @@ -1,376 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - _WaitHelper._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = cls._schema_on_200.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = cls._schema_on_200.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - _WaitHelper._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(properties.subnet) - - sku = cls._schema_on_200.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = cls._schema_on_200.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_ipsec_policies = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - vpn_client_protocols = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = cls._schema_on_200.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/ipsec_policy/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/ipsec_policy/__cmd_group.py deleted file mode 100644 index a9ec1c2b484..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/ipsec_policy/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet-gateway ipsec-policy", -) -class __CMDGroup(AAZCommandGroup): - """Manage virtual network gateway IPSec policies. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/ipsec_policy/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/ipsec_policy/__init__.py deleted file mode 100644 index 233ea53b2ea..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/ipsec_policy/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._add import * -from ._list import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/ipsec_policy/_add.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/ipsec_policy/_add.py deleted file mode 100644 index 2836ea6165f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/ipsec_policy/_add.py +++ /dev/null @@ -1,645 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway ipsec-policy add", -) -class Add(AAZCommand): - """Add a virtual network gateway IPSec policy. - - :example: Add specified IPsec policies to a gateway instead of relying on defaults. - az network vnet-gateway ipsec-policy add -g MyResourceGroup --gateway-name MyGateway --dh-group DHGroup14 --ike-encryption AES256 --ike-integrity SHA384 --ipsec-encryption DES3 --ipsec-integrity GCMAES256 --pfs-group PFS2048 --sa-lifetime 27000 --sa-max-size 102400000 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2018-11-01", "properties.vpnClientConfiguration.vpnClientIpsecPolicies[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - ) - _args_schema.vpn_client_ipsec_policy_index = AAZIntArg( - options=["--vpn-client-ipsec-policy-index"], - ) - - # define Arg Group "IKE Phase 1" - - _args_schema = cls._args_schema - _args_schema.dh_group = AAZStrArg( - options=["--dh-group"], - arg_group="IKE Phase 1", - help="The DH Group used in initial SA.", - required=True, - enum={"DHGroup1": "DHGroup1", "DHGroup14": "DHGroup14", "DHGroup2": "DHGroup2", "DHGroup2048": "DHGroup2048", "DHGroup24": "DHGroup24", "ECP256": "ECP256", "ECP384": "ECP384", "None": "None"}, - ) - _args_schema.ipsec_encryption = AAZStrArg( - options=["--ipsec-encryption"], - arg_group="IKE Phase 1", - help="The IPSec encryption algorithm.", - required=True, - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3", "GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "None": "None"}, - ) - _args_schema.ipsec_integrity = AAZStrArg( - options=["--ipsec-integrity"], - arg_group="IKE Phase 1", - help="The IPSec integrity algorithm.", - required=True, - enum={"GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256"}, - ) - - # define Arg Group "IKE Phase 2" - - _args_schema = cls._args_schema - _args_schema.ike_encryption = AAZStrArg( - options=["--ike-encryption"], - arg_group="IKE Phase 2", - help="The IKE encryption algorithm.", - required=True, - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3", "GCMAES128": "GCMAES128", "GCMAES256": "GCMAES256"}, - ) - _args_schema.ike_integrity = AAZStrArg( - options=["--ike-integrity"], - arg_group="IKE Phase 2", - help="The IKE integrity algorithm.", - required=True, - enum={"GCMAES128": "GCMAES128", "GCMAES256": "GCMAES256", "MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256", "SHA384": "SHA384"}, - ) - _args_schema.pfs_group = AAZStrArg( - options=["--pfs-group"], - arg_group="IKE Phase 2", - help="The Pfs Group used for new child SA.", - required=True, - enum={"ECP256": "ECP256", "ECP384": "ECP384", "None": "None", "PFS1": "PFS1", "PFS14": "PFS14", "PFS2": "PFS2", "PFS2048": "PFS2048", "PFS24": "PFS24", "PFSMM": "PFSMM"}, - ) - - # define Arg Group "Security Association" - - _args_schema = cls._args_schema - _args_schema.sa_max_size = AAZIntArg( - options=["--sa-max-size"], - arg_group="Security Association", - help="The payload size in KB for P2S client.", - required=True, - ) - _args_schema.sa_lifetime = AAZIntArg( - options=["--sa-lifetime"], - arg_group="Security Association", - help="The lifetime in seconds for P2S client.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientIpsecPolicies - filters = enumerate(result) - filters = filter( - lambda e: e[0] == self.ctx.args.vpn_client_ipsec_policy_index, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientIpsecPolicies - filters = enumerate(result) - filters = filter( - lambda e: e[0] == self.ctx.args.vpn_client_ipsec_policy_index, - filters - ) - idx = next(filters, [len(result)])[0] - self.ctx.args.vpn_client_ipsec_policy_index = idx - result[idx] = value - return - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _AddHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _AddHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("dhGroup", AAZStrType, ".dh_group", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ikeEncryption", AAZStrType, ".ike_encryption", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ikeIntegrity", AAZStrType, ".ike_integrity", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ipsecEncryption", AAZStrType, ".ipsec_encryption", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ipsecIntegrity", AAZStrType, ".ipsec_integrity", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("pfsGroup", AAZStrType, ".pfs_group", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("saDataSizeKilobytes", AAZIntType, ".sa_max_size", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("saLifeTimeSeconds", AAZIntType, ".sa_lifetime", typ_kwargs={"flags": {"required": True}}) - - return _instance_value - - -class _AddHelper: - """Helper class for Add""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Add"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/ipsec_policy/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/ipsec_policy/_list.py deleted file mode 100644 index 4646ba9b234..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/ipsec_policy/_list.py +++ /dev/null @@ -1,416 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway ipsec-policy list", -) -class List(AAZCommand): - """List IPSec policies associated with a virtual network gateway. - - :example: List the IPsec policies set on a gateway. - az network vnet-gateway ipsec-policy list -g MyResourceGroup --gateway-name MyConnection - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2018-11-01", "properties.vpnClientConfiguration.vpnClientIpsecPolicies"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.vpnClientConfiguration.vpnClientIpsecPolicies - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.vpnClientConfiguration.vpnClientIpsecPolicies = value - return - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/ipsec_policy/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/ipsec_policy/_wait.py deleted file mode 100644 index 5605e391bb2..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/ipsec_policy/_wait.py +++ /dev/null @@ -1,401 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway ipsec-policy wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2018-11-01", "properties.vpnClientConfiguration.vpnClientIpsecPolicies[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/revoked_cert/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/revoked_cert/__cmd_group.py deleted file mode 100644 index ca7e7a8061f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/revoked_cert/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet-gateway revoked-cert", -) -class __CMDGroup(AAZCommandGroup): - """Manage revoked certificates in a virtual network gateway. Prevent machines using this certificate from accessing Azure through this gateway. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/revoked_cert/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/revoked_cert/__init__.py deleted file mode 100644 index cf0f7e303bd..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/revoked_cert/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/revoked_cert/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/revoked_cert/_create.py deleted file mode 100644 index a00d43272da..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/revoked_cert/_create.py +++ /dev/null @@ -1,584 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway revoked-cert create", -) -class Create(AAZCommand): - """Revoke a certificate. - - :example: Revoke a certificate. - az network vnet-gateway revoked-cert create -g MyResourceGroup -n MyRootCertificate --gateway-name MyVnetGateway --thumbprint abc123 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2018-11-01", "properties.vpnClientConfiguration.vpnClientRevokedCertificates[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Root certificate name.", - required=True, - ) - _args_schema.thumbprint = AAZStrArg( - options=["--thumbprint"], - help="Certificate thumbprint.", - ) - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRevokedCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRevokedCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("thumbprint", AAZStrType, ".thumbprint") - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/revoked_cert/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/revoked_cert/_delete.py deleted file mode 100644 index 57b55ff2ee9..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/revoked_cert/_delete.py +++ /dev/null @@ -1,563 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway revoked-cert delete", -) -class Delete(AAZCommand): - """Delete a revoked certificate. - - :example: Delete a revoked certificate. - az network vnet-gateway revoked-cert delete -g MyResourceGroup -n MyRootCertificate --gateway-name MyVnetGateway - - :example: Delete a revoked certificate. - az network vnet-gateway revoked-cert delete --gateway-name MyVnetGateway --name MyRootCertificate --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2018-11-01", "properties.vpnClientConfiguration.vpnClientRevokedCertificates[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Root certificate name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRevokedCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRevokedCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/revoked_cert/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/revoked_cert/_wait.py deleted file mode 100644 index 040771ac857..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/revoked_cert/_wait.py +++ /dev/null @@ -1,401 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway revoked-cert wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2018-11-01", "properties.vpnClientConfiguration.vpnClientRevokedCertificates[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/root_cert/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/root_cert/__cmd_group.py deleted file mode 100644 index c69c7128a05..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/root_cert/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet-gateway root-cert", -) -class __CMDGroup(AAZCommandGroup): - """Manage root certificates of a virtual network gateway. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/root_cert/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/root_cert/__init__.py deleted file mode 100644 index cf0f7e303bd..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/root_cert/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/root_cert/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/root_cert/_create.py deleted file mode 100644 index 965106e855a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/root_cert/_create.py +++ /dev/null @@ -1,585 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway root-cert create", -) -class Create(AAZCommand): - """Upload a root certificate. - - :example: Add a Root Certificate to the list of certs allowed to connect to this Gateway. - az network vnet-gateway root-cert create -g MyResourceGroup -n MyRootCertificate --gateway-name MyVnetGateway --public-cert-data MyCertificateData - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2018-11-01", "properties.vpnClientConfiguration.vpnClientRootCertificates[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Root certificate name.", - required=True, - ) - _args_schema.root_cert_data = AAZStrArg( - options=["--root-cert-data"], - help="Base64 contents of the root certificate file or file path.", - required=True, - ) - - # define Arg Group "Properties" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRootCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRootCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _CreateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _CreateHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("publicCertData", AAZStrType, ".root_cert_data", typ_kwargs={"flags": {"required": True}}) - - return _instance_value - - -class _CreateHelper: - """Helper class for Create""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/root_cert/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/root_cert/_delete.py deleted file mode 100644 index ec615aa9f26..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/root_cert/_delete.py +++ /dev/null @@ -1,563 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway root-cert delete", -) -class Delete(AAZCommand): - """Delete a root certificate. - - :example: Remove a certificate from the list of Root Certificates whose children are allowed to access this Gateway. - az network vnet-gateway root-cert delete -g MyResourceGroup -n MyRootCertificate --gateway-name MyVnetGateway - - :example: Delete a root certificate. - az network vnet-gateway root-cert delete --gateway-name MyVnetGateway --name MyRootCertificate --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2018-11-01", "properties.vpnClientConfiguration.vpnClientRootCertificates[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Root certificate name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.pre_instance_delete() - self.InstanceDeleteByJson(ctx=self.ctx)() - self.post_instance_delete() - yield self.VirtualNetworkGatewaysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_delete(self): - pass - - @register_callback - def post_instance_delete(self): - pass - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRootCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.vpnClientConfiguration.vpnClientRootCertificates - filters = enumerate(result) - filters = filter( - lambda e: e[1].name == self.ctx.args.name, - filters - ) - idx = next(filters, [len(result)])[0] - result[idx] = value - return - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _DeleteHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewaysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _DeleteHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceDeleteByJson(AAZJsonInstanceDeleteOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._delete_instance()) - - -class _DeleteHelper: - """Helper class for Delete""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/root_cert/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/root_cert/_wait.py deleted file mode 100644 index 98d946f19bf..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/root_cert/_wait.py +++ /dev/null @@ -1,401 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway root-cert wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}", "2018-11-01", "properties.vpnClientConfiguration.vpnClientRootCertificates[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - help="Virtual network gateway name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.gateway_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_virtual_network_gateway_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - bgp_settings = _schema_virtual_network_gateway_read.properties.bgp_settings - bgp_settings.asn = AAZIntType() - bgp_settings.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_address_pool = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool - vpn_client_address_pool.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_address_pool.address_prefixes - address_prefixes.Element = AAZStrType() - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/__cmd_group.py deleted file mode 100644 index 91bef18b63a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet-gateway vpn-client", -) -class __CMDGroup(AAZCommandGroup): - """Download a VPN client configuration required to connect to Azure via point-to-site. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/__init__.py deleted file mode 100644 index c53ec198366..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._generate import * -from ._generate_vpn_profile import * -from ._show_url import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/_generate.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/_generate.py deleted file mode 100644 index 3ec48b8e656..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/_generate.py +++ /dev/null @@ -1,232 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class Generate(AAZCommand): - """Generate VPN client configuration. - - :example: Create the VPN client configuration for RADIUS with EAP-MSCHAV2 authentication. - az network vnet-gateway vpn-client generate -g MyResourceGroup -n MyVnetGateway --authentication-method EAPMSCHAPv2 - - :example: Create the VPN client configuration for AMD64 architecture. - az network vnet-gateway vpn-client generate -g MyResourceGroup -n MyVnetGateway --processor-architecture Amd64 - - :example: Generate VPN client configuration. - az network vnet-gateway vpn-client generate --name MyVnetGateway --processor-architecture Amd64 --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/generatevpnclientpackage", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.authentication_method = AAZStrArg( - options=["--authentication-method"], - arg_group="Parameters", - help="Method used to authenticate with the generated client.", - enum={"EAPMSCHAPv2": "EAPMSCHAPv2", "EAPTLS": "EAPTLS"}, - ) - _args_schema.client_root_certificates = AAZListArg( - options=["--client-root-certificates"], - arg_group="Parameters", - help="Space-separated list of client root certificate public certificate data in Base-64 format. Optional for external Radius-based auth with EAPTLS.", - ) - _args_schema.processor_architecture = AAZStrArg( - options=["--processor-architecture"], - arg_group="Parameters", - help="Processor architecture of the target system.", - enum={"Amd64": "Amd64", "X86": "X86"}, - ) - _args_schema.radius_server_auth_certificate = AAZStrArg( - options=["--radius-server-auth-certificate"], - arg_group="Parameters", - help="Public certificate data for the Radius server auth certificate in Base-64 format. Required only if external Radius auth has been configured with EAPTLS auth.", - ) - - client_root_certificates = cls._args_schema.client_root_certificates - client_root_certificates.Element = AAZStrArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysGeneratevpnclientpackage(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGeneratevpnclientpackage(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("authenticationMethod", AAZStrType, ".authentication_method") - _builder.set_prop("clientRootCertificates", AAZListType, ".client_root_certificates") - _builder.set_prop("processorArchitecture", AAZStrType, ".processor_architecture") - _builder.set_prop("radiusServerAuthCertificate", AAZStrType, ".radius_server_auth_certificate") - - client_root_certificates = _builder.get(".clientRootCertificates") - if client_root_certificates is not None: - client_root_certificates.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZStrType() - - return cls._schema_on_200 - - -class _GenerateHelper: - """Helper class for Generate""" - - -__all__ = ["Generate"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/_generate_vpn_profile.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/_generate_vpn_profile.py deleted file mode 100644 index 45c8ae874ed..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/_generate_vpn_profile.py +++ /dev/null @@ -1,223 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class GenerateVpnProfile(AAZCommand): - """Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication. - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/generatevpnprofile", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.authentication_method = AAZStrArg( - options=["--authentication-method"], - arg_group="Parameters", - help="VPN client authentication method.", - enum={"EAPMSCHAPv2": "EAPMSCHAPv2", "EAPTLS": "EAPTLS"}, - ) - _args_schema.client_root_certificates = AAZListArg( - options=["--client-root-certificates"], - arg_group="Parameters", - help="A list of client root certificates public certificate data encoded as Base-64 strings. Optional parameter for external radius based authentication with EAPTLS.", - ) - _args_schema.processor_architecture = AAZStrArg( - options=["--processor-architecture"], - arg_group="Parameters", - help="VPN client Processor Architecture.", - enum={"Amd64": "Amd64", "X86": "X86"}, - ) - _args_schema.radius_server_auth_certificate = AAZStrArg( - options=["--radius-server-auth-certificate"], - arg_group="Parameters", - help="The public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with EAPTLS authentication.", - ) - - client_root_certificates = cls._args_schema.client_root_certificates - client_root_certificates.Element = AAZStrArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysGenerateVpnProfile(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGenerateVpnProfile(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("authenticationMethod", AAZStrType, ".authentication_method") - _builder.set_prop("clientRootCertificates", AAZListType, ".client_root_certificates") - _builder.set_prop("processorArchitecture", AAZStrType, ".processor_architecture") - _builder.set_prop("radiusServerAuthCertificate", AAZStrType, ".radius_server_auth_certificate") - - client_root_certificates = _builder.get(".clientRootCertificates") - if client_root_certificates is not None: - client_root_certificates.set_elements(AAZStrType, ".") - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZStrType() - - return cls._schema_on_200 - - -class _GenerateVpnProfileHelper: - """Helper class for GenerateVpnProfile""" - - -__all__ = ["GenerateVpnProfile"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/_show_url.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/_show_url.py deleted file mode 100644 index 29034c286e3..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/_show_url.py +++ /dev/null @@ -1,179 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway vpn-client show-url", -) -class ShowUrl(AAZCommand): - """Retrieve a pre-generated VPN client configuration. - - :example: Get the pre-generated point-to-site VPN client of the virtual network gateway. - az network vnet-gateway vpn-client show-url -g MyResourceGroup -n MyVnetGateway - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/getvpnprofilepackageurl", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysGetVpnProfilePackageUrl(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysGetVpnProfilePackageUrl(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZStrType() - - return cls._schema_on_200 - - -class _ShowUrlHelper: - """Helper class for ShowUrl""" - - -__all__ = ["ShowUrl"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/ipsec_policy/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/ipsec_policy/__cmd_group.py deleted file mode 100644 index 8ace6e163f3..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/ipsec_policy/__cmd_group.py +++ /dev/null @@ -1,24 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vnet-gateway vpn-client ipsec-policy", - is_preview=True, -) -class __CMDGroup(AAZCommandGroup): - """Manage the VPN client connection ipsec-policy for P2S client connection of the virtual network gateway. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/ipsec_policy/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/ipsec_policy/__init__.py deleted file mode 100644 index 4a524a853c8..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/ipsec_policy/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._set import * -from ._show import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/ipsec_policy/_set.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/ipsec_policy/_set.py deleted file mode 100644 index 6d0321ab1b6..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/ipsec_policy/_set.py +++ /dev/null @@ -1,301 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway vpn-client ipsec-policy set", - is_preview=True, -) -class Set(AAZCommand): - """Set the VPN client connection ipsec policy per P2S client connection of the virtual network gateway. - - :example: Set the VPN client connection ipsec policy per P2S client connection of the virtual network gateway. - az network vnet-gateway vpn-client ipsec-policy set -g MyResourceGroup -n MyVnetGateway --dh-group DHGroup14 --ike-encryption AES256 --ike-integrity SHA384 --ipsec-encryption DES3 --ipsec-integrity GCMAES256 --pfs-group PFS2048 --sa-lifetime 27000 --sa-max-size 102400000 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/setvpnclientipsecparameters", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - - # define Arg Group "IKE Phase 1" - - _args_schema = cls._args_schema - _args_schema.dh_group = AAZStrArg( - options=["--dh-group"], - arg_group="IKE Phase 1", - help="The DH Groups used for initial SA.", - required=True, - enum={"DHGroup1": "DHGroup1", "DHGroup14": "DHGroup14", "DHGroup2": "DHGroup2", "DHGroup2048": "DHGroup2048", "DHGroup24": "DHGroup24", "ECP256": "ECP256", "ECP384": "ECP384", "None": "None"}, - ) - _args_schema.ipsec_encryption = AAZStrArg( - options=["--ipsec-encryption"], - arg_group="IKE Phase 1", - help="The IPSec encryption algorithm.", - required=True, - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3", "GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "None": "None"}, - ) - _args_schema.ipsec_integrity = AAZStrArg( - options=["--ipsec-integrity"], - arg_group="IKE Phase 1", - help="The IPSec integrity algorithm.", - required=True, - enum={"GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256"}, - ) - - # define Arg Group "IKE Phase 2" - - _args_schema = cls._args_schema - _args_schema.ike_encryption = AAZStrArg( - options=["--ike-encryption"], - arg_group="IKE Phase 2", - help="The IKE encryption algorithm.", - required=True, - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3", "GCMAES128": "GCMAES128", "GCMAES256": "GCMAES256"}, - ) - _args_schema.ike_integrity = AAZStrArg( - options=["--ike-integrity"], - arg_group="IKE Phase 2", - help="The IKE integrity algorithm.", - required=True, - enum={"GCMAES128": "GCMAES128", "GCMAES256": "GCMAES256", "MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256", "SHA384": "SHA384"}, - ) - _args_schema.pfs_group = AAZStrArg( - options=["--pfs-group"], - arg_group="IKE Phase 2", - help="The Pfs Groups used for new child SA.", - required=True, - enum={"ECP256": "ECP256", "ECP384": "ECP384", "None": "None", "PFS1": "PFS1", "PFS14": "PFS14", "PFS2": "PFS2", "PFS2048": "PFS2048", "PFS24": "PFS24", "PFSMM": "PFSMM"}, - ) - - # define Arg Group "Security Association" - - _args_schema = cls._args_schema - _args_schema.sa_max_size = AAZIntArg( - options=["--sa-max-size"], - arg_group="Security Association", - help="The payload size in KB for P2S client.", - required=True, - ) - _args_schema.sa_lifetime = AAZIntArg( - options=["--sa-lifetime"], - arg_group="Security Association", - help="The lifetime in seconds for P2S client.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysSetVpnclientIpsecParameters(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysSetVpnclientIpsecParameters(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("dhGroup", AAZStrType, ".dh_group", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ikeEncryption", AAZStrType, ".ike_encryption", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ikeIntegrity", AAZStrType, ".ike_integrity", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ipsecEncryption", AAZStrType, ".ipsec_encryption", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ipsecIntegrity", AAZStrType, ".ipsec_integrity", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("pfsGroup", AAZStrType, ".pfs_group", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("saDataSizeKilobytes", AAZIntType, ".sa_max_size", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("saLifeTimeSeconds", AAZIntType, ".sa_lifetime", typ_kwargs={"flags": {"required": True}}) - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _schema_on_200.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _schema_on_200.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _schema_on_200.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _schema_on_200.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _schema_on_200.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _schema_on_200.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _schema_on_200.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - return cls._schema_on_200 - - -class _SetHelper: - """Helper class for Set""" - - -__all__ = ["Set"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/ipsec_policy/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/ipsec_policy/_show.py deleted file mode 100644 index 8d98742dde1..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vnet_gateway/vpn_client/ipsec_policy/_show.py +++ /dev/null @@ -1,214 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vnet-gateway vpn-client ipsec-policy show", - is_preview=True, -) -class Show(AAZCommand): - """Get the VPN client connection ipsec policy per P2S client connection of the virtual network gateway. - - :example: Get the VPN client connection ipsec policy per P2S client connection of the virtual network gateway. - az network vnet-gateway vpn-client ipsec-policy show -g MyResourceGroup -n MyVnetGateway - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/getvpnclientipsecparameters", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Name of the VNet gateway.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewaysGetVpnclientIpsecParameters(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewaysGetVpnclientIpsecParameters(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _schema_on_200.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _schema_on_200.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _schema_on_200.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _schema_on_200.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _schema_on_200.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _schema_on_200.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _schema_on_200.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/__cmd_group.py deleted file mode 100644 index 7668b41df2f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/__cmd_group.py +++ /dev/null @@ -1,25 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vpn-connection", -) -class __CMDGroup(AAZCommandGroup): - """Manage VPN connections. - - For more information on site-to-site connections, visit https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-cli. For more information on Vnet-to-Vnet connections, visit https://learn.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-vnet-vnet-cli. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/__init__.py deleted file mode 100644 index 6acd4543b6e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._delete import * -from ._list import * -from ._list_connection import * -from ._show import * -from ._show_device_config_script import * -from ._update import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_delete.py deleted file mode 100644 index 479a1a8f9ef..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_delete.py +++ /dev/null @@ -1,162 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection delete", -) -class Delete(AAZCommand): - """Delete a VPN connection. - - :example: Delete a VPN connection. - az network vpn-connection delete -g MyResourceGroup -n MyConnection - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, None) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Connection name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewayConnectionsDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - class VirtualNetworkGatewayConnectionsDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [204]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_204, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - def on_200(self, session): - pass - - def on_204(self, session): - pass - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_list.py deleted file mode 100644 index 585d6bfaf4b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_list.py +++ /dev/null @@ -1,609 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class List(AAZCommand): - """List all VPN connections. - - :example: List all VPN connections in a resource group. - az network vpn-connection list -g MyResourceGroup - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsList(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class VirtualNetworkGatewayConnectionsList(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_protocol = AAZStrType( - serialized_name="connectionProtocol", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.express_route_gateway_bypass = AAZBoolType( - serialized_name="expressRouteGatewayBypass", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - _ListHelper._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - _ListHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - _ListHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - ipsec_policies = cls._schema_on_200.value.Element.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - _ListHelper._build_schema_ipsec_policy_read(ipsec_policies.Element) - - local_network_gateway2 = cls._schema_on_200.value.Element.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - _ListHelper._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - _ListHelper._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = cls._schema_on_200.value.Element.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tunnel_connection_status = cls._schema_on_200.value.Element.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_ipsec_policy_read = None - - @classmethod - def _build_schema_ipsec_policy_read(cls, _schema): - if cls._schema_ipsec_policy_read is not None: - _schema.dh_group = cls._schema_ipsec_policy_read.dh_group - _schema.ike_encryption = cls._schema_ipsec_policy_read.ike_encryption - _schema.ike_integrity = cls._schema_ipsec_policy_read.ike_integrity - _schema.ipsec_encryption = cls._schema_ipsec_policy_read.ipsec_encryption - _schema.ipsec_integrity = cls._schema_ipsec_policy_read.ipsec_integrity - _schema.pfs_group = cls._schema_ipsec_policy_read.pfs_group - _schema.sa_data_size_kilobytes = cls._schema_ipsec_policy_read.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._schema_ipsec_policy_read.sa_life_time_seconds - return - - cls._schema_ipsec_policy_read = _schema_ipsec_policy_read = AAZObjectType() - - ipsec_policy_read = _schema_ipsec_policy_read - ipsec_policy_read.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - ipsec_policy_read.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - ipsec_policy_read.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - ipsec_policy_read.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - ipsec_policy_read.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - ipsec_policy_read.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - ipsec_policy_read.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - ipsec_policy_read.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - _schema.dh_group = cls._schema_ipsec_policy_read.dh_group - _schema.ike_encryption = cls._schema_ipsec_policy_read.ike_encryption - _schema.ike_integrity = cls._schema_ipsec_policy_read.ike_integrity - _schema.ipsec_encryption = cls._schema_ipsec_policy_read.ipsec_encryption - _schema.ipsec_integrity = cls._schema_ipsec_policy_read.ipsec_integrity - _schema.pfs_group = cls._schema_ipsec_policy_read.pfs_group - _schema.sa_data_size_kilobytes = cls._schema_ipsec_policy_read.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._schema_ipsec_policy_read.sa_life_time_seconds - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - cls._build_schema_ipsec_policy_read(vpn_client_ipsec_policies.Element) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_list_connection.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_list_connection.py deleted file mode 100644 index 3b68fdfe1b6..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_list_connection.py +++ /dev/null @@ -1,331 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 * - - -class ListConnection(AAZCommand): - """List all the connections in a virtual network gateway. - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/virtualnetworkgateways/{}/connections", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_paging(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.vnet_gateway = AAZStrArg( - options=["--vnet-gateway"], - help="Name of the VNet gateway.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysListConnections(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - return result, next_link - - class VirtualNetworkGatewaysListConnections(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayName", self.ctx.args.vnet_gateway, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.next_link = AAZStrType( - serialized_name="nextLink", - flags={"read_only": True}, - ) - _schema_on_200.value = AAZListType() - - value = cls._schema_on_200.value - value.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.location = AAZStrType() - _element.name = AAZStrType( - flags={"read_only": True}, - ) - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _element.tags = AAZDictType() - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.value.Element.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_protocol = AAZStrType( - serialized_name="connectionProtocol", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.express_route_gateway_bypass = AAZBoolType( - serialized_name="expressRouteGatewayBypass", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - _ListConnectionHelper._build_schema_virtual_network_connection_gateway_reference_read(properties.local_network_gateway2) - properties.peer = AAZObjectType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - _ListConnectionHelper._build_schema_virtual_network_connection_gateway_reference_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - _ListConnectionHelper._build_schema_virtual_network_connection_gateway_reference_read(properties.virtual_network_gateway2) - - ipsec_policies = cls._schema_on_200.value.Element.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.ipsec_policies.Element - _element.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - _element.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - _element.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - _element.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - _element.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - _element.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - _element.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - _element.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - peer = cls._schema_on_200.value.Element.properties.peer - peer.id = AAZStrType() - - tunnel_connection_status = cls._schema_on_200.value.Element.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = cls._schema_on_200.value.Element.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = cls._schema_on_200.value.Element.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ListConnectionHelper: - """Helper class for ListConnection""" - - _schema_virtual_network_connection_gateway_reference_read = None - - @classmethod - def _build_schema_virtual_network_connection_gateway_reference_read(cls, _schema): - if cls._schema_virtual_network_connection_gateway_reference_read is not None: - _schema.id = cls._schema_virtual_network_connection_gateway_reference_read.id - return - - cls._schema_virtual_network_connection_gateway_reference_read = _schema_virtual_network_connection_gateway_reference_read = AAZObjectType() - - virtual_network_connection_gateway_reference_read = _schema_virtual_network_connection_gateway_reference_read - virtual_network_connection_gateway_reference_read.id = AAZStrType( - flags={"required": True}, - ) - - _schema.id = cls._schema_virtual_network_connection_gateway_reference_read.id - - -__all__ = ["ListConnection"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_show.py deleted file mode 100644 index 69c1f989f4d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_show.py +++ /dev/null @@ -1,612 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection show", -) -class Show(AAZCommand): - """Get the details of a VPN connection. - - :example: View the details of a VPN connection. - az network vpn-connection show -g MyResourceGroup -n MyConnection - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Connection name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewayConnectionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_protocol = AAZStrType( - serialized_name="connectionProtocol", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.express_route_gateway_bypass = AAZBoolType( - serialized_name="expressRouteGatewayBypass", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - _ShowHelper._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - _ShowHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - _ShowHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - ipsec_policies = cls._schema_on_200.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - _ShowHelper._build_schema_ipsec_policy_read(ipsec_policies.Element) - - local_network_gateway2 = cls._schema_on_200.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - _ShowHelper._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - _ShowHelper._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = cls._schema_on_200.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tunnel_connection_status = cls._schema_on_200.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_ipsec_policy_read = None - - @classmethod - def _build_schema_ipsec_policy_read(cls, _schema): - if cls._schema_ipsec_policy_read is not None: - _schema.dh_group = cls._schema_ipsec_policy_read.dh_group - _schema.ike_encryption = cls._schema_ipsec_policy_read.ike_encryption - _schema.ike_integrity = cls._schema_ipsec_policy_read.ike_integrity - _schema.ipsec_encryption = cls._schema_ipsec_policy_read.ipsec_encryption - _schema.ipsec_integrity = cls._schema_ipsec_policy_read.ipsec_integrity - _schema.pfs_group = cls._schema_ipsec_policy_read.pfs_group - _schema.sa_data_size_kilobytes = cls._schema_ipsec_policy_read.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._schema_ipsec_policy_read.sa_life_time_seconds - return - - cls._schema_ipsec_policy_read = _schema_ipsec_policy_read = AAZObjectType() - - ipsec_policy_read = _schema_ipsec_policy_read - ipsec_policy_read.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - ipsec_policy_read.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - ipsec_policy_read.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - ipsec_policy_read.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - ipsec_policy_read.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - ipsec_policy_read.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - ipsec_policy_read.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - ipsec_policy_read.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - _schema.dh_group = cls._schema_ipsec_policy_read.dh_group - _schema.ike_encryption = cls._schema_ipsec_policy_read.ike_encryption - _schema.ike_integrity = cls._schema_ipsec_policy_read.ike_integrity - _schema.ipsec_encryption = cls._schema_ipsec_policy_read.ipsec_encryption - _schema.ipsec_integrity = cls._schema_ipsec_policy_read.ipsec_integrity - _schema.pfs_group = cls._schema_ipsec_policy_read.pfs_group - _schema.sa_data_size_kilobytes = cls._schema_ipsec_policy_read.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._schema_ipsec_policy_read.sa_life_time_seconds - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - cls._build_schema_ipsec_policy_read(vpn_client_ipsec_policies.Element) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_show_device_config_script.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_show_device_config_script.py deleted file mode 100644 index 5ca782c525c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_show_device_config_script.py +++ /dev/null @@ -1,191 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection show-device-config-script", - is_preview=True, -) -class ShowDeviceConfigScript(AAZCommand): - """Get a XML format representation for VPN connection device configuration script. - - :example: Get a XML format representation for VPN connection device configuration script. - az network vpn-connection show-device-config-script -g MyResourceGroup -n MyConnection --vendor "Cisco" --device-family "Cisco-ISR(IOS)" --firmware-version "Cisco-ISR-15.x-- IKEv2+BGP" - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}/vpndeviceconfigurationscript", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Connection name.", - required=True, - id_part="name", - ) - _args_schema.device_family = AAZStrArg( - options=["--device-family"], - help="The device family for the vpn device.", - ) - _args_schema.firmware_version = AAZStrArg( - options=["--firmware-version"], - help="The firmware version for the vpn device.", - ) - _args_schema.vendor = AAZStrArg( - options=["--vendor"], - help="The vendor for the vpn device.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewaysVpnDeviceConfigurationScript(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewaysVpnDeviceConfigurationScript(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("deviceFamily", AAZStrType, ".device_family") - _builder.set_prop("firmwareVersion", AAZStrType, ".firmware_version") - _builder.set_prop("vendor", AAZStrType, ".vendor") - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZStrType() - - return cls._schema_on_200 - - -class _ShowDeviceConfigScriptHelper: - """Helper class for ShowDeviceConfigScript""" - - -__all__ = ["ShowDeviceConfigScript"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_update.py deleted file mode 100644 index 905e93c44e5..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_update.py +++ /dev/null @@ -1,1472 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection update", -) -class Update(AAZCommand): - """Update a VPN connection. - - :example: Add BGP to an existing connection. - az network vpn-connection update -g MyResourceGroup -n MyConnection --enable-bgp True - - :example: Update a VPN connection. - az network vpn-connection update --name MyConnection --resource-group MyResourceGroup --use-policy-based-traffic-selectors true - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Connection name.", - required=True, - id_part="name", - ) - _args_schema.enable_bgp = AAZBoolArg( - options=["--enable-bgp"], - help="Enable BGP (Border Gateway Protocol).", - nullable=True, - ) - _args_schema.express_route_gateway_bypass = AAZBoolArg( - options=["--express-route-gateway-bypass"], - help="Bypass ExpressRoute gateway for data forwarding.", - nullable=True, - ) - _args_schema.routing_weight = AAZIntArg( - options=["--routing-weight"], - help="Connection routing weight.", - nullable=True, - ) - _args_schema.shared_key = AAZStrArg( - options=["--shared-key"], - help="Shared IPSec key.", - nullable=True, - ) - _args_schema.use_policy_based_traffic_selectors = AAZBoolArg( - options=["--use-policy-based-traffic-selectors"], - help="Enable policy-based traffic selectors.", - nullable=True, - ) - _args_schema.tags = AAZDictArg( - options=["--tags"], - help="Space-separated tags: key[=value] [key[=value] ...]. Use \"\" to clear existing tags.", - nullable=True, - ) - - tags = cls._args_schema.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - # define Arg Group "Parameters" - - # define Arg Group "Properties" - - _args_schema = cls._args_schema - _args_schema.ipsec_policies = AAZListArg( - options=["--ipsec-policies"], - arg_group="Properties", - help="The IPSec Policies to be considered by this connection.", - nullable=True, - ) - - ipsec_policies = cls._args_schema.ipsec_policies - ipsec_policies.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_schema.ipsec_policies.Element - _element.dh_group = AAZStrArg( - options=["dh-group"], - help="The DH Groups used in IKE Phase 1 for initial SA.", - enum={"DHGroup1": "DHGroup1", "DHGroup14": "DHGroup14", "DHGroup2": "DHGroup2", "DHGroup2048": "DHGroup2048", "DHGroup24": "DHGroup24", "ECP256": "ECP256", "ECP384": "ECP384", "None": "None"}, - ) - _element.ike_encryption = AAZStrArg( - options=["ike-encryption"], - help="The IKE encryption algorithm (IKE phase 2).", - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3", "GCMAES128": "GCMAES128", "GCMAES256": "GCMAES256"}, - ) - _element.ike_integrity = AAZStrArg( - options=["ike-integrity"], - help="The IKE integrity algorithm (IKE phase 2).", - enum={"GCMAES128": "GCMAES128", "GCMAES256": "GCMAES256", "MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256", "SHA384": "SHA384"}, - ) - _element.ipsec_encryption = AAZStrArg( - options=["ipsec-encryption"], - help="The IPSec encryption algorithm (IKE phase 1).", - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3", "GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "None": "None"}, - ) - _element.ipsec_integrity = AAZStrArg( - options=["ipsec-integrity"], - help="The IPSec integrity algorithm (IKE phase 1).", - enum={"GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256"}, - ) - _element.pfs_group = AAZStrArg( - options=["pfs-group"], - help="The Pfs Groups used in IKE Phase 2 for new child SA.", - enum={"ECP256": "ECP256", "ECP384": "ECP384", "None": "None", "PFS1": "PFS1", "PFS14": "PFS14", "PFS2": "PFS2", "PFS2048": "PFS2048", "PFS24": "PFS24", "PFSMM": "PFSMM"}, - ) - _element.sa_data_size_kilobytes = AAZIntArg( - options=["sa-data-size-kilobytes"], - help="The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel.", - ) - _element.sa_life_time_seconds = AAZIntArg( - options=["sa-life-time-seconds"], - help="The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel.", - ) - return cls._args_schema - - _args_address_space_update = None - - @classmethod - def _build_args_address_space_update(cls, _schema): - if cls._args_address_space_update is not None: - _schema.address_prefixes = cls._args_address_space_update.address_prefixes - return - - cls._args_address_space_update = AAZObjectArg( - nullable=True, - ) - - address_space_update = cls._args_address_space_update - address_space_update.address_prefixes = AAZListArg( - options=["address-prefixes"], - help="A list of address blocks reserved for this virtual network in CIDR notation.", - nullable=True, - ) - - address_prefixes = cls._args_address_space_update.address_prefixes - address_prefixes.Element = AAZStrArg( - nullable=True, - ) - - _schema.address_prefixes = cls._args_address_space_update.address_prefixes - - _args_bgp_settings_update = None - - @classmethod - def _build_args_bgp_settings_update(cls, _schema): - if cls._args_bgp_settings_update is not None: - _schema.asn = cls._args_bgp_settings_update.asn - _schema.bgp_peering_address = cls._args_bgp_settings_update.bgp_peering_address - _schema.peer_weight = cls._args_bgp_settings_update.peer_weight - return - - cls._args_bgp_settings_update = AAZObjectArg( - nullable=True, - ) - - bgp_settings_update = cls._args_bgp_settings_update - bgp_settings_update.asn = AAZIntArg( - options=["asn"], - help="The BGP speaker's ASN.", - nullable=True, - ) - bgp_settings_update.bgp_peering_address = AAZStrArg( - options=["bgp-peering-address"], - help="The BGP peering address and BGP identifier of this BGP speaker.", - nullable=True, - ) - bgp_settings_update.peer_weight = AAZIntArg( - options=["peer-weight"], - help="The weight added to routes learned from this BGP speaker.", - nullable=True, - ) - - _schema.asn = cls._args_bgp_settings_update.asn - _schema.bgp_peering_address = cls._args_bgp_settings_update.bgp_peering_address - _schema.peer_weight = cls._args_bgp_settings_update.peer_weight - - _args_ipsec_policy_update = None - - @classmethod - def _build_args_ipsec_policy_update(cls, _schema): - if cls._args_ipsec_policy_update is not None: - _schema.dh_group = cls._args_ipsec_policy_update.dh_group - _schema.ike_encryption = cls._args_ipsec_policy_update.ike_encryption - _schema.ike_integrity = cls._args_ipsec_policy_update.ike_integrity - _schema.ipsec_encryption = cls._args_ipsec_policy_update.ipsec_encryption - _schema.ipsec_integrity = cls._args_ipsec_policy_update.ipsec_integrity - _schema.pfs_group = cls._args_ipsec_policy_update.pfs_group - _schema.sa_data_size_kilobytes = cls._args_ipsec_policy_update.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._args_ipsec_policy_update.sa_life_time_seconds - return - - cls._args_ipsec_policy_update = AAZObjectArg( - nullable=True, - ) - - ipsec_policy_update = cls._args_ipsec_policy_update - ipsec_policy_update.dh_group = AAZStrArg( - options=["dh-group"], - help="The DH Group used in IKE Phase 1 for initial SA.", - enum={"DHGroup1": "DHGroup1", "DHGroup14": "DHGroup14", "DHGroup2": "DHGroup2", "DHGroup2048": "DHGroup2048", "DHGroup24": "DHGroup24", "ECP256": "ECP256", "ECP384": "ECP384", "None": "None"}, - ) - ipsec_policy_update.ike_encryption = AAZStrArg( - options=["ike-encryption"], - help="The IKE encryption algorithm (IKE phase 2).", - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3", "GCMAES128": "GCMAES128", "GCMAES256": "GCMAES256"}, - ) - ipsec_policy_update.ike_integrity = AAZStrArg( - options=["ike-integrity"], - help="The IKE integrity algorithm (IKE phase 2).", - enum={"GCMAES128": "GCMAES128", "GCMAES256": "GCMAES256", "MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256", "SHA384": "SHA384"}, - ) - ipsec_policy_update.ipsec_encryption = AAZStrArg( - options=["ipsec-encryption"], - help="The IPSec encryption algorithm (IKE phase 1).", - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3", "GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "None": "None"}, - ) - ipsec_policy_update.ipsec_integrity = AAZStrArg( - options=["ipsec-integrity"], - help="The IPSec integrity algorithm (IKE phase 1).", - enum={"GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256"}, - ) - ipsec_policy_update.pfs_group = AAZStrArg( - options=["pfs-group"], - help="The Pfs Group used in IKE Phase 2 for new child SA.", - enum={"ECP256": "ECP256", "ECP384": "ECP384", "None": "None", "PFS1": "PFS1", "PFS14": "PFS14", "PFS2": "PFS2", "PFS2048": "PFS2048", "PFS24": "PFS24", "PFSMM": "PFSMM"}, - ) - ipsec_policy_update.sa_data_size_kilobytes = AAZIntArg( - options=["sa-data-size-kilobytes"], - help="The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel.", - ) - ipsec_policy_update.sa_life_time_seconds = AAZIntArg( - options=["sa-life-time-seconds"], - help="The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel.", - ) - - _schema.dh_group = cls._args_ipsec_policy_update.dh_group - _schema.ike_encryption = cls._args_ipsec_policy_update.ike_encryption - _schema.ike_integrity = cls._args_ipsec_policy_update.ike_integrity - _schema.ipsec_encryption = cls._args_ipsec_policy_update.ipsec_encryption - _schema.ipsec_integrity = cls._args_ipsec_policy_update.ipsec_integrity - _schema.pfs_group = cls._args_ipsec_policy_update.pfs_group - _schema.sa_data_size_kilobytes = cls._args_ipsec_policy_update.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._args_ipsec_policy_update.sa_life_time_seconds - - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - - _args_virtual_network_gateway_update = None - - @classmethod - def _build_args_virtual_network_gateway_update(cls, _schema): - if cls._args_virtual_network_gateway_update is not None: - _schema.active_active = cls._args_virtual_network_gateway_update.active_active - _schema.bgp_settings = cls._args_virtual_network_gateway_update.bgp_settings - _schema.enable_bgp = cls._args_virtual_network_gateway_update.enable_bgp - _schema.etag = cls._args_virtual_network_gateway_update.etag - _schema.gateway_default_site = cls._args_virtual_network_gateway_update.gateway_default_site - _schema.gateway_type = cls._args_virtual_network_gateway_update.gateway_type - _schema.ip_configurations = cls._args_virtual_network_gateway_update.ip_configurations - _schema.location = cls._args_virtual_network_gateway_update.location - _schema.resource_guid = cls._args_virtual_network_gateway_update.resource_guid - _schema.sku = cls._args_virtual_network_gateway_update.sku - _schema.tags = cls._args_virtual_network_gateway_update.tags - _schema.vpn_client_configuration = cls._args_virtual_network_gateway_update.vpn_client_configuration - _schema.vpn_type = cls._args_virtual_network_gateway_update.vpn_type - return - - cls._args_virtual_network_gateway_update = AAZObjectArg() - - virtual_network_gateway_update = cls._args_virtual_network_gateway_update - virtual_network_gateway_update.etag = AAZStrArg( - options=["etag"], - help="Gets a unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - virtual_network_gateway_update.location = AAZResourceLocationArg( - options=["l", "location"], - help="Resource location.", - nullable=True, - fmt=AAZResourceLocationArgFormat( - resource_group_arg="resource_group", - ), - ) - virtual_network_gateway_update.active_active = AAZBoolArg( - options=["active-active"], - help="ActiveActive flag.", - nullable=True, - ) - virtual_network_gateway_update.bgp_settings = AAZObjectArg( - options=["bgp-settings"], - help="Virtual network gateway's BGP speaker settings.", - nullable=True, - ) - cls._build_args_bgp_settings_update(virtual_network_gateway_update.bgp_settings) - virtual_network_gateway_update.enable_bgp = AAZBoolArg( - options=["enable-bgp"], - help="Whether BGP is enabled for this virtual network gateway or not.", - nullable=True, - ) - virtual_network_gateway_update.gateway_default_site = AAZObjectArg( - options=["gateway-default-site"], - help="The reference to the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting.", - nullable=True, - ) - cls._build_args_sub_resource_update(virtual_network_gateway_update.gateway_default_site) - virtual_network_gateway_update.gateway_type = AAZStrArg( - options=["gateway-type"], - help="The type of this virtual network gateway.", - nullable=True, - enum={"ExpressRoute": "ExpressRoute", "Vpn": "Vpn"}, - ) - virtual_network_gateway_update.ip_configurations = AAZListArg( - options=["ip-configurations"], - help="IP configurations for virtual network gateway.", - nullable=True, - ) - virtual_network_gateway_update.resource_guid = AAZStrArg( - options=["resource-guid"], - help="The resource GUID property of the VirtualNetworkGateway resource.", - nullable=True, - ) - virtual_network_gateway_update.sku = AAZObjectArg( - options=["sku"], - help="The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway.", - nullable=True, - ) - virtual_network_gateway_update.vpn_client_configuration = AAZObjectArg( - options=["vpn-client-configuration"], - help="The reference to the VpnClientConfiguration resource which represents the P2S VpnClient configurations.", - nullable=True, - ) - virtual_network_gateway_update.vpn_type = AAZStrArg( - options=["vpn-type"], - help="The type of this virtual network gateway.", - nullable=True, - enum={"PolicyBased": "PolicyBased", "RouteBased": "RouteBased"}, - ) - virtual_network_gateway_update.tags = AAZDictArg( - options=["tags"], - help="Resource tags.", - nullable=True, - ) - - ip_configurations = cls._args_virtual_network_gateway_update.ip_configurations - ip_configurations.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_virtual_network_gateway_update.ip_configurations.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.private_ip_allocation_method = AAZStrArg( - options=["private-ip-allocation-method"], - help="The private IP address allocation method.", - nullable=True, - enum={"Dynamic": "Dynamic", "Static": "Static"}, - ) - _element.public_ip_address = AAZObjectArg( - options=["public-ip-address"], - help="The reference to the public IP resource.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.public_ip_address) - _element.subnet = AAZObjectArg( - options=["subnet"], - help="The reference to the subnet resource.", - nullable=True, - ) - cls._build_args_sub_resource_update(_element.subnet) - - sku = cls._args_virtual_network_gateway_update.sku - sku.capacity = AAZIntArg( - options=["capacity"], - help="The capacity.", - nullable=True, - ) - sku.name = AAZStrArg( - options=["name"], - help="Gateway SKU name.", - nullable=True, - enum={"Basic": "Basic", "ErGw1AZ": "ErGw1AZ", "ErGw2AZ": "ErGw2AZ", "ErGw3AZ": "ErGw3AZ", "HighPerformance": "HighPerformance", "Standard": "Standard", "UltraPerformance": "UltraPerformance", "VpnGw1": "VpnGw1", "VpnGw1AZ": "VpnGw1AZ", "VpnGw2": "VpnGw2", "VpnGw2AZ": "VpnGw2AZ", "VpnGw3": "VpnGw3", "VpnGw3AZ": "VpnGw3AZ"}, - ) - sku.tier = AAZStrArg( - options=["tier"], - help="Gateway SKU tier.", - nullable=True, - enum={"Basic": "Basic", "ErGw1AZ": "ErGw1AZ", "ErGw2AZ": "ErGw2AZ", "ErGw3AZ": "ErGw3AZ", "HighPerformance": "HighPerformance", "Standard": "Standard", "UltraPerformance": "UltraPerformance", "VpnGw1": "VpnGw1", "VpnGw1AZ": "VpnGw1AZ", "VpnGw2": "VpnGw2", "VpnGw2AZ": "VpnGw2AZ", "VpnGw3": "VpnGw3", "VpnGw3AZ": "VpnGw3AZ"}, - ) - - vpn_client_configuration = cls._args_virtual_network_gateway_update.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrArg( - options=["radius-server-address"], - help="The radius server address property of the VirtualNetworkGateway resource for vpn client connection.", - nullable=True, - ) - vpn_client_configuration.radius_server_secret = AAZStrArg( - options=["radius-server-secret"], - help="The radius secret property of the VirtualNetworkGateway resource for vpn client connection.", - nullable=True, - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectArg( - options=["vpn-client-address-pool"], - help="The reference to the address space resource which represents Address space for P2S VpnClient.", - nullable=True, - ) - cls._build_args_address_space_update(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListArg( - options=["vpn-client-ipsec-policies"], - help="VpnClientIpsecPolicies for virtual network gateway P2S client.", - nullable=True, - ) - vpn_client_configuration.vpn_client_protocols = AAZListArg( - options=["vpn-client-protocols"], - help="VpnClientProtocols for Virtual network gateway.", - nullable=True, - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListArg( - options=["vpn-client-revoked-certificates"], - help="VpnClientRevokedCertificate for Virtual network gateway.", - nullable=True, - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListArg( - options=["vpn-client-root-certificates"], - help="VpnClientRootCertificate for virtual network gateway.", - nullable=True, - ) - - vpn_client_ipsec_policies = cls._args_virtual_network_gateway_update.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectArg( - nullable=True, - ) - cls._build_args_ipsec_policy_update(vpn_client_ipsec_policies.Element) - - vpn_client_protocols = cls._args_virtual_network_gateway_update.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrArg( - nullable=True, - enum={"IkeV2": "IkeV2", "OpenVPN": "OpenVPN", "SSTP": "SSTP"}, - ) - - vpn_client_revoked_certificates = cls._args_virtual_network_gateway_update.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_virtual_network_gateway_update.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.thumbprint = AAZStrArg( - options=["thumbprint"], - help="The revoked VPN client certificate thumbprint.", - nullable=True, - ) - - vpn_client_root_certificates = cls._args_virtual_network_gateway_update.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectArg( - nullable=True, - ) - - _element = cls._args_virtual_network_gateway_update.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrArg( - options=["etag"], - help="A unique read-only string that changes whenever the resource is updated.", - nullable=True, - ) - _element.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - _element.name = AAZStrArg( - options=["name"], - help="The name of the resource that is unique within a resource group. This name can be used to access the resource.", - nullable=True, - ) - _element.public_cert_data = AAZStrArg( - options=["public-cert-data"], - help="The certificate public data.", - ) - - tags = cls._args_virtual_network_gateway_update.tags - tags.Element = AAZStrArg( - nullable=True, - ) - - _schema.active_active = cls._args_virtual_network_gateway_update.active_active - _schema.bgp_settings = cls._args_virtual_network_gateway_update.bgp_settings - _schema.enable_bgp = cls._args_virtual_network_gateway_update.enable_bgp - _schema.etag = cls._args_virtual_network_gateway_update.etag - _schema.gateway_default_site = cls._args_virtual_network_gateway_update.gateway_default_site - _schema.gateway_type = cls._args_virtual_network_gateway_update.gateway_type - _schema.ip_configurations = cls._args_virtual_network_gateway_update.ip_configurations - _schema.location = cls._args_virtual_network_gateway_update.location - _schema.resource_guid = cls._args_virtual_network_gateway_update.resource_guid - _schema.sku = cls._args_virtual_network_gateway_update.sku - _schema.tags = cls._args_virtual_network_gateway_update.tags - _schema.vpn_client_configuration = cls._args_virtual_network_gateway_update.vpn_client_configuration - _schema.vpn_type = cls._args_virtual_network_gateway_update.vpn_type - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGet(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.VirtualNetworkGatewayConnectionsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewayConnectionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_gateway_connection_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewayConnectionsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_virtual_network_gateway_connection_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("enableBgp", AAZBoolType, ".enable_bgp") - properties.set_prop("expressRouteGatewayBypass", AAZBoolType, ".express_route_gateway_bypass") - properties.set_prop("ipsecPolicies", AAZListType, ".ipsec_policies") - properties.set_prop("routingWeight", AAZIntType, ".routing_weight") - properties.set_prop("sharedKey", AAZStrType, ".shared_key") - properties.set_prop("usePolicyBasedTrafficSelectors", AAZBoolType, ".use_policy_based_traffic_selectors") - - ipsec_policies = _builder.get(".properties.ipsecPolicies") - if ipsec_policies is not None: - ipsec_policies.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipsecPolicies[]") - if _elements is not None: - _elements.set_prop("dhGroup", AAZStrType, ".dh_group", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("ikeEncryption", AAZStrType, ".ike_encryption", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("ikeIntegrity", AAZStrType, ".ike_integrity", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("ipsecEncryption", AAZStrType, ".ipsec_encryption", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("ipsecIntegrity", AAZStrType, ".ipsec_integrity", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("pfsGroup", AAZStrType, ".pfs_group", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("saDataSizeKilobytes", AAZIntType, ".sa_data_size_kilobytes", typ_kwargs={"flags": {"required": True}}) - _elements.set_prop("saLifeTimeSeconds", AAZIntType, ".sa_life_time_seconds", typ_kwargs={"flags": {"required": True}}) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - @classmethod - def _build_schema_address_space_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("addressPrefixes", AAZListType, ".address_prefixes") - - address_prefixes = _builder.get(".addressPrefixes") - if address_prefixes is not None: - address_prefixes.set_elements(AAZStrType, ".") - - @classmethod - def _build_schema_bgp_settings_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("asn", AAZIntType, ".asn") - _builder.set_prop("bgpPeeringAddress", AAZStrType, ".bgp_peering_address") - _builder.set_prop("peerWeight", AAZIntType, ".peer_weight") - - @classmethod - def _build_schema_ipsec_policy_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("dhGroup", AAZStrType, ".dh_group", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ikeEncryption", AAZStrType, ".ike_encryption", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ikeIntegrity", AAZStrType, ".ike_integrity", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ipsecEncryption", AAZStrType, ".ipsec_encryption", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ipsecIntegrity", AAZStrType, ".ipsec_integrity", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("pfsGroup", AAZStrType, ".pfs_group", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("saDataSizeKilobytes", AAZIntType, ".sa_data_size_kilobytes", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("saLifeTimeSeconds", AAZIntType, ".sa_life_time_seconds", typ_kwargs={"flags": {"required": True}}) - - @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("id", AAZStrType, ".id") - - @classmethod - def _build_schema_virtual_network_gateway_update(cls, _builder): - if _builder is None: - return - _builder.set_prop("etag", AAZStrType, ".etag") - _builder.set_prop("location", AAZStrType, ".location") - _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - _builder.set_prop("tags", AAZDictType, ".tags") - - properties = _builder.get(".properties") - if properties is not None: - properties.set_prop("activeActive", AAZBoolType, ".active_active") - cls._build_schema_bgp_settings_update(properties.set_prop("bgpSettings", AAZObjectType, ".bgp_settings")) - properties.set_prop("enableBgp", AAZBoolType, ".enable_bgp") - cls._build_schema_sub_resource_update(properties.set_prop("gatewayDefaultSite", AAZObjectType, ".gateway_default_site")) - properties.set_prop("gatewayType", AAZStrType, ".gateway_type") - properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations") - properties.set_prop("resourceGuid", AAZStrType, ".resource_guid") - properties.set_prop("sku", AAZObjectType, ".sku") - properties.set_prop("vpnClientConfiguration", AAZObjectType, ".vpn_client_configuration") - properties.set_prop("vpnType", AAZStrType, ".vpn_type") - - ip_configurations = _builder.get(".properties.ipConfigurations") - if ip_configurations is not None: - ip_configurations.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.ipConfigurations[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.ipConfigurations[].properties") - if properties is not None: - properties.set_prop("privateIPAllocationMethod", AAZStrType, ".private_ip_allocation_method") - cls._build_schema_sub_resource_update(properties.set_prop("publicIPAddress", AAZObjectType, ".public_ip_address")) - cls._build_schema_sub_resource_update(properties.set_prop("subnet", AAZObjectType, ".subnet")) - - sku = _builder.get(".properties.sku") - if sku is not None: - sku.set_prop("capacity", AAZIntType, ".capacity") - sku.set_prop("name", AAZStrType, ".name") - sku.set_prop("tier", AAZStrType, ".tier") - - vpn_client_configuration = _builder.get(".properties.vpnClientConfiguration") - if vpn_client_configuration is not None: - vpn_client_configuration.set_prop("radiusServerAddress", AAZStrType, ".radius_server_address") - vpn_client_configuration.set_prop("radiusServerSecret", AAZStrType, ".radius_server_secret") - cls._build_schema_address_space_update(vpn_client_configuration.set_prop("vpnClientAddressPool", AAZObjectType, ".vpn_client_address_pool")) - vpn_client_configuration.set_prop("vpnClientIpsecPolicies", AAZListType, ".vpn_client_ipsec_policies") - vpn_client_configuration.set_prop("vpnClientProtocols", AAZListType, ".vpn_client_protocols") - vpn_client_configuration.set_prop("vpnClientRevokedCertificates", AAZListType, ".vpn_client_revoked_certificates") - vpn_client_configuration.set_prop("vpnClientRootCertificates", AAZListType, ".vpn_client_root_certificates") - - vpn_client_ipsec_policies = _builder.get(".properties.vpnClientConfiguration.vpnClientIpsecPolicies") - if vpn_client_ipsec_policies is not None: - cls._build_schema_ipsec_policy_update(vpn_client_ipsec_policies.set_elements(AAZObjectType, ".")) - - vpn_client_protocols = _builder.get(".properties.vpnClientConfiguration.vpnClientProtocols") - if vpn_client_protocols is not None: - vpn_client_protocols.set_elements(AAZStrType, ".") - - vpn_client_revoked_certificates = _builder.get(".properties.vpnClientConfiguration.vpnClientRevokedCertificates") - if vpn_client_revoked_certificates is not None: - vpn_client_revoked_certificates.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.vpnClientConfiguration.vpnClientRevokedCertificates[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}}) - - properties = _builder.get(".properties.vpnClientConfiguration.vpnClientRevokedCertificates[].properties") - if properties is not None: - properties.set_prop("thumbprint", AAZStrType, ".thumbprint") - - vpn_client_root_certificates = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates") - if vpn_client_root_certificates is not None: - vpn_client_root_certificates.set_elements(AAZObjectType, ".") - - _elements = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[]") - if _elements is not None: - _elements.set_prop("etag", AAZStrType, ".etag") - _elements.set_prop("id", AAZStrType, ".id") - _elements.set_prop("name", AAZStrType, ".name") - _elements.set_prop("properties", AAZObjectType, ".", typ_kwargs={"flags": {"required": True, "client_flatten": True}}) - - properties = _builder.get(".properties.vpnClientConfiguration.vpnClientRootCertificates[].properties") - if properties is not None: - properties.set_prop("publicCertData", AAZStrType, ".public_cert_data", typ_kwargs={"flags": {"required": True}}) - - tags = _builder.get(".tags") - if tags is not None: - tags.set_elements(AAZStrType, ".") - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_ipsec_policy_read = None - - @classmethod - def _build_schema_ipsec_policy_read(cls, _schema): - if cls._schema_ipsec_policy_read is not None: - _schema.dh_group = cls._schema_ipsec_policy_read.dh_group - _schema.ike_encryption = cls._schema_ipsec_policy_read.ike_encryption - _schema.ike_integrity = cls._schema_ipsec_policy_read.ike_integrity - _schema.ipsec_encryption = cls._schema_ipsec_policy_read.ipsec_encryption - _schema.ipsec_integrity = cls._schema_ipsec_policy_read.ipsec_integrity - _schema.pfs_group = cls._schema_ipsec_policy_read.pfs_group - _schema.sa_data_size_kilobytes = cls._schema_ipsec_policy_read.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._schema_ipsec_policy_read.sa_life_time_seconds - return - - cls._schema_ipsec_policy_read = _schema_ipsec_policy_read = AAZObjectType() - - ipsec_policy_read = _schema_ipsec_policy_read - ipsec_policy_read.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - ipsec_policy_read.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - ipsec_policy_read.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - ipsec_policy_read.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - ipsec_policy_read.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - ipsec_policy_read.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - ipsec_policy_read.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - ipsec_policy_read.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - _schema.dh_group = cls._schema_ipsec_policy_read.dh_group - _schema.ike_encryption = cls._schema_ipsec_policy_read.ike_encryption - _schema.ike_integrity = cls._schema_ipsec_policy_read.ike_integrity - _schema.ipsec_encryption = cls._schema_ipsec_policy_read.ipsec_encryption - _schema.ipsec_integrity = cls._schema_ipsec_policy_read.ipsec_integrity - _schema.pfs_group = cls._schema_ipsec_policy_read.pfs_group - _schema.sa_data_size_kilobytes = cls._schema_ipsec_policy_read.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._schema_ipsec_policy_read.sa_life_time_seconds - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_connection_read = None - - @classmethod - def _build_schema_virtual_network_gateway_connection_read(cls, _schema): - if cls._schema_virtual_network_gateway_connection_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - return - - cls._schema_virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read = AAZObjectType() - - virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read - virtual_network_gateway_connection_read.etag = AAZStrType() - virtual_network_gateway_connection_read.id = AAZStrType() - virtual_network_gateway_connection_read.location = AAZStrType() - virtual_network_gateway_connection_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_connection_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_connection_read.tags = AAZDictType() - virtual_network_gateway_connection_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_protocol = AAZStrType( - serialized_name="connectionProtocol", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.express_route_gateway_bypass = AAZBoolType( - serialized_name="expressRouteGatewayBypass", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - cls._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - ipsec_policies = _schema_virtual_network_gateway_connection_read.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - cls._build_schema_ipsec_policy_read(ipsec_policies.Element) - - local_network_gateway2 = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - cls._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tunnel_connection_status = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = _schema_virtual_network_gateway_connection_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - cls._build_schema_ipsec_policy_read(vpn_client_ipsec_policies.Element) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_wait.py deleted file mode 100644 index ad5f0264b4a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/_wait.py +++ /dev/null @@ -1,608 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.name = AAZStrArg( - options=["-n", "--name"], - help="Connection name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewayConnectionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.etag = AAZStrType() - _schema_on_200.id = AAZStrType() - _schema_on_200.location = AAZStrType() - _schema_on_200.name = AAZStrType( - flags={"read_only": True}, - ) - _schema_on_200.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - _schema_on_200.tags = AAZDictType() - _schema_on_200.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_protocol = AAZStrType( - serialized_name="connectionProtocol", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.express_route_gateway_bypass = AAZBoolType( - serialized_name="expressRouteGatewayBypass", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - _WaitHelper._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - _WaitHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - _WaitHelper._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - ipsec_policies = cls._schema_on_200.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - _WaitHelper._build_schema_ipsec_policy_read(ipsec_policies.Element) - - local_network_gateway2 = cls._schema_on_200.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = cls._schema_on_200.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - _WaitHelper._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - _WaitHelper._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = cls._schema_on_200.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tunnel_connection_status = cls._schema_on_200.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = cls._schema_on_200.tags - tags.Element = AAZStrType() - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_ipsec_policy_read = None - - @classmethod - def _build_schema_ipsec_policy_read(cls, _schema): - if cls._schema_ipsec_policy_read is not None: - _schema.dh_group = cls._schema_ipsec_policy_read.dh_group - _schema.ike_encryption = cls._schema_ipsec_policy_read.ike_encryption - _schema.ike_integrity = cls._schema_ipsec_policy_read.ike_integrity - _schema.ipsec_encryption = cls._schema_ipsec_policy_read.ipsec_encryption - _schema.ipsec_integrity = cls._schema_ipsec_policy_read.ipsec_integrity - _schema.pfs_group = cls._schema_ipsec_policy_read.pfs_group - _schema.sa_data_size_kilobytes = cls._schema_ipsec_policy_read.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._schema_ipsec_policy_read.sa_life_time_seconds - return - - cls._schema_ipsec_policy_read = _schema_ipsec_policy_read = AAZObjectType() - - ipsec_policy_read = _schema_ipsec_policy_read - ipsec_policy_read.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - ipsec_policy_read.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - ipsec_policy_read.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - ipsec_policy_read.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - ipsec_policy_read.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - ipsec_policy_read.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - ipsec_policy_read.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - ipsec_policy_read.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - _schema.dh_group = cls._schema_ipsec_policy_read.dh_group - _schema.ike_encryption = cls._schema_ipsec_policy_read.ike_encryption - _schema.ike_integrity = cls._schema_ipsec_policy_read.ike_integrity - _schema.ipsec_encryption = cls._schema_ipsec_policy_read.ipsec_encryption - _schema.ipsec_integrity = cls._schema_ipsec_policy_read.ipsec_integrity - _schema.pfs_group = cls._schema_ipsec_policy_read.pfs_group - _schema.sa_data_size_kilobytes = cls._schema_ipsec_policy_read.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._schema_ipsec_policy_read.sa_life_time_seconds - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - cls._build_schema_ipsec_policy_read(vpn_client_ipsec_policies.Element) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/ipsec_policy/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/ipsec_policy/__cmd_group.py deleted file mode 100644 index 3accbdc67e7..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/ipsec_policy/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vpn-connection ipsec-policy", -) -class __CMDGroup(AAZCommandGroup): - """Manage VPN connection IPSec policies. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/ipsec_policy/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/ipsec_policy/__init__.py deleted file mode 100644 index 233ea53b2ea..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/ipsec_policy/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._add import * -from ._list import * -from ._wait import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/ipsec_policy/_add.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/ipsec_policy/_add.py deleted file mode 100644 index 4351c390a6c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/ipsec_policy/_add.py +++ /dev/null @@ -1,880 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection ipsec-policy add", -) -class Add(AAZCommand): - """Add a VPN connection IPSec policy. - - Set all IPsec policies of a VPN connection. If you want to set any IPsec policy, you must - set them all. - - :example: Add specified IPsec policies to a connection instead of relying on defaults. - az network vpn-connection ipsec-policy add -g MyResourceGroup --connection-name MyConnection --dh-group DHGroup14 --ike-encryption AES256 --ike-integrity SHA384 --ipsec-encryption DES3 --ipsec-integrity GCMAES256 --pfs-group PFS2048 --sa-lifetime 27000 --sa-max-size 102400000 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2018-11-01", "properties.ipsecPolicies[]"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.connection_name = AAZStrArg( - options=["--connection-name"], - help="Connection name.", - required=True, - ) - _args_schema.ipsec_policy_index = AAZIntArg( - options=["--ipsec-policy-index"], - ) - - # define Arg Group "IKE Phase 1" - - _args_schema = cls._args_schema - _args_schema.dh_group = AAZStrArg( - options=["--dh-group"], - arg_group="IKE Phase 1", - help="The DH Groups used for initial SA.", - required=True, - enum={"DHGroup1": "DHGroup1", "DHGroup14": "DHGroup14", "DHGroup2": "DHGroup2", "DHGroup2048": "DHGroup2048", "DHGroup24": "DHGroup24", "ECP256": "ECP256", "ECP384": "ECP384", "None": "None"}, - ) - _args_schema.ipsec_encryption = AAZStrArg( - options=["--ipsec-encryption"], - arg_group="IKE Phase 1", - help="The IPSec encryption algorithm.", - required=True, - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3", "GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "None": "None"}, - ) - _args_schema.ipsec_integrity = AAZStrArg( - options=["--ipsec-integrity"], - arg_group="IKE Phase 1", - help="The IPSec integrity algorithm.", - required=True, - enum={"GCMAES128": "GCMAES128", "GCMAES192": "GCMAES192", "GCMAES256": "GCMAES256", "MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256"}, - ) - - # define Arg Group "IKE Phase 2" - - _args_schema = cls._args_schema - _args_schema.ike_encryption = AAZStrArg( - options=["--ike-encryption"], - arg_group="IKE Phase 2", - help="The IKE encryption algorithm.", - required=True, - enum={"AES128": "AES128", "AES192": "AES192", "AES256": "AES256", "DES": "DES", "DES3": "DES3", "GCMAES128": "GCMAES128", "GCMAES256": "GCMAES256"}, - ) - _args_schema.ike_integrity = AAZStrArg( - options=["--ike-integrity"], - arg_group="IKE Phase 2", - help="The IKE integrity algorithm.", - required=True, - enum={"GCMAES128": "GCMAES128", "GCMAES256": "GCMAES256", "MD5": "MD5", "SHA1": "SHA1", "SHA256": "SHA256", "SHA384": "SHA384"}, - ) - _args_schema.pfs_group = AAZStrArg( - options=["--pfs-group"], - arg_group="IKE Phase 2", - help="The Pfs Groups used for new child SA.", - required=True, - enum={"ECP256": "ECP256", "ECP384": "ECP384", "None": "None", "PFS1": "PFS1", "PFS14": "PFS14", "PFS2": "PFS2", "PFS2048": "PFS2048", "PFS24": "PFS24", "PFSMM": "PFSMM"}, - ) - - # define Arg Group "Security Association" - - _args_schema = cls._args_schema - _args_schema.sa_max_size = AAZIntArg( - options=["--sa-max-size"], - arg_group="Security Association", - help="The payload size in KB for P2S client.", - required=True, - ) - _args_schema.sa_lifetime = AAZIntArg( - options=["--sa-lifetime"], - arg_group="Security Association", - help="The lifetime in seconds for P2S client.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGet(ctx=self.ctx)() - self.pre_instance_create() - self.InstanceCreateByJson(ctx=self.ctx)() - self.post_instance_create(self.ctx.selectors.subresource.required()) - yield self.VirtualNetworkGatewayConnectionsCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_create(self): - pass - - @register_callback - def post_instance_create(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - result = result.properties.ipsecPolicies - filters = enumerate(result) - filters = filter( - lambda e: e[0] == self.ctx.args.ipsec_policy_index, - filters - ) - idx = next(filters)[0] - return result[idx] - - def _set(self, value): - result = self.ctx.vars.instance - result = result.properties.ipsecPolicies - filters = enumerate(result) - filters = filter( - lambda e: e[0] == self.ctx.args.ipsec_policy_index, - filters - ) - idx = next(filters, [len(result)])[0] - self.ctx.args.ipsec_policy_index = idx - result[idx] = value - return - - class VirtualNetworkGatewayConnectionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _AddHelper._build_schema_virtual_network_gateway_connection_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewayConnectionsCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _AddHelper._build_schema_virtual_network_gateway_connection_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceCreateByJson(AAZJsonInstanceCreateOperation): - - def __call__(self, *args, **kwargs): - self.ctx.selectors.subresource.set(self._create_instance()) - - def _create_instance(self): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType - ) - _builder.set_prop("dhGroup", AAZStrType, ".dh_group", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ikeEncryption", AAZStrType, ".ike_encryption", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ikeIntegrity", AAZStrType, ".ike_integrity", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ipsecEncryption", AAZStrType, ".ipsec_encryption", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("ipsecIntegrity", AAZStrType, ".ipsec_integrity", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("pfsGroup", AAZStrType, ".pfs_group", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("saDataSizeKilobytes", AAZIntType, ".sa_max_size", typ_kwargs={"flags": {"required": True}}) - _builder.set_prop("saLifeTimeSeconds", AAZIntType, ".sa_lifetime", typ_kwargs={"flags": {"required": True}}) - - return _instance_value - - -class _AddHelper: - """Helper class for Add""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_ipsec_policy_read = None - - @classmethod - def _build_schema_ipsec_policy_read(cls, _schema): - if cls._schema_ipsec_policy_read is not None: - _schema.dh_group = cls._schema_ipsec_policy_read.dh_group - _schema.ike_encryption = cls._schema_ipsec_policy_read.ike_encryption - _schema.ike_integrity = cls._schema_ipsec_policy_read.ike_integrity - _schema.ipsec_encryption = cls._schema_ipsec_policy_read.ipsec_encryption - _schema.ipsec_integrity = cls._schema_ipsec_policy_read.ipsec_integrity - _schema.pfs_group = cls._schema_ipsec_policy_read.pfs_group - _schema.sa_data_size_kilobytes = cls._schema_ipsec_policy_read.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._schema_ipsec_policy_read.sa_life_time_seconds - return - - cls._schema_ipsec_policy_read = _schema_ipsec_policy_read = AAZObjectType() - - ipsec_policy_read = _schema_ipsec_policy_read - ipsec_policy_read.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - ipsec_policy_read.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - ipsec_policy_read.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - ipsec_policy_read.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - ipsec_policy_read.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - ipsec_policy_read.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - ipsec_policy_read.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - ipsec_policy_read.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - _schema.dh_group = cls._schema_ipsec_policy_read.dh_group - _schema.ike_encryption = cls._schema_ipsec_policy_read.ike_encryption - _schema.ike_integrity = cls._schema_ipsec_policy_read.ike_integrity - _schema.ipsec_encryption = cls._schema_ipsec_policy_read.ipsec_encryption - _schema.ipsec_integrity = cls._schema_ipsec_policy_read.ipsec_integrity - _schema.pfs_group = cls._schema_ipsec_policy_read.pfs_group - _schema.sa_data_size_kilobytes = cls._schema_ipsec_policy_read.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._schema_ipsec_policy_read.sa_life_time_seconds - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_connection_read = None - - @classmethod - def _build_schema_virtual_network_gateway_connection_read(cls, _schema): - if cls._schema_virtual_network_gateway_connection_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - return - - cls._schema_virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read = AAZObjectType() - - virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read - virtual_network_gateway_connection_read.etag = AAZStrType() - virtual_network_gateway_connection_read.id = AAZStrType() - virtual_network_gateway_connection_read.location = AAZStrType() - virtual_network_gateway_connection_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_connection_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_connection_read.tags = AAZDictType() - virtual_network_gateway_connection_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_protocol = AAZStrType( - serialized_name="connectionProtocol", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.express_route_gateway_bypass = AAZBoolType( - serialized_name="expressRouteGatewayBypass", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - cls._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - ipsec_policies = _schema_virtual_network_gateway_connection_read.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - cls._build_schema_ipsec_policy_read(ipsec_policies.Element) - - local_network_gateway2 = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - cls._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tunnel_connection_status = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = _schema_virtual_network_gateway_connection_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - cls._build_schema_ipsec_policy_read(vpn_client_ipsec_policies.Element) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Add"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/ipsec_policy/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/ipsec_policy/_list.py deleted file mode 100644 index 67a4800d0cc..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/ipsec_policy/_list.py +++ /dev/null @@ -1,648 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection ipsec-policy list", -) -class List(AAZCommand): - """List IPSec policies associated with a VPN connection. - - :example: List the IPsec policies set on a connection. - az network vpn-connection ipsec-policy list -g MyResourceGroup --connection-name MyConnection - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2018-11-01", "properties.ipsecPolicies"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self.SubresourceSelector(ctx=self.ctx, name="subresource") - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.connection_name = AAZStrArg( - options=["--connection-name"], - help="Connection name.", - required=True, - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.selectors.subresource.required(), client_flatten=True) - return result - - class SubresourceSelector(AAZJsonSelector): - - def _get(self): - result = self.ctx.vars.instance - return result.properties.ipsecPolicies - - def _set(self, value): - result = self.ctx.vars.instance - result.properties.ipsecPolicies = value - return - - class VirtualNetworkGatewayConnectionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _ListHelper._build_schema_virtual_network_gateway_connection_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _ListHelper: - """Helper class for List""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_ipsec_policy_read = None - - @classmethod - def _build_schema_ipsec_policy_read(cls, _schema): - if cls._schema_ipsec_policy_read is not None: - _schema.dh_group = cls._schema_ipsec_policy_read.dh_group - _schema.ike_encryption = cls._schema_ipsec_policy_read.ike_encryption - _schema.ike_integrity = cls._schema_ipsec_policy_read.ike_integrity - _schema.ipsec_encryption = cls._schema_ipsec_policy_read.ipsec_encryption - _schema.ipsec_integrity = cls._schema_ipsec_policy_read.ipsec_integrity - _schema.pfs_group = cls._schema_ipsec_policy_read.pfs_group - _schema.sa_data_size_kilobytes = cls._schema_ipsec_policy_read.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._schema_ipsec_policy_read.sa_life_time_seconds - return - - cls._schema_ipsec_policy_read = _schema_ipsec_policy_read = AAZObjectType() - - ipsec_policy_read = _schema_ipsec_policy_read - ipsec_policy_read.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - ipsec_policy_read.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - ipsec_policy_read.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - ipsec_policy_read.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - ipsec_policy_read.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - ipsec_policy_read.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - ipsec_policy_read.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - ipsec_policy_read.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - _schema.dh_group = cls._schema_ipsec_policy_read.dh_group - _schema.ike_encryption = cls._schema_ipsec_policy_read.ike_encryption - _schema.ike_integrity = cls._schema_ipsec_policy_read.ike_integrity - _schema.ipsec_encryption = cls._schema_ipsec_policy_read.ipsec_encryption - _schema.ipsec_integrity = cls._schema_ipsec_policy_read.ipsec_integrity - _schema.pfs_group = cls._schema_ipsec_policy_read.pfs_group - _schema.sa_data_size_kilobytes = cls._schema_ipsec_policy_read.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._schema_ipsec_policy_read.sa_life_time_seconds - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_connection_read = None - - @classmethod - def _build_schema_virtual_network_gateway_connection_read(cls, _schema): - if cls._schema_virtual_network_gateway_connection_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - return - - cls._schema_virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read = AAZObjectType() - - virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read - virtual_network_gateway_connection_read.etag = AAZStrType() - virtual_network_gateway_connection_read.id = AAZStrType() - virtual_network_gateway_connection_read.location = AAZStrType() - virtual_network_gateway_connection_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_connection_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_connection_read.tags = AAZDictType() - virtual_network_gateway_connection_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_protocol = AAZStrType( - serialized_name="connectionProtocol", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.express_route_gateway_bypass = AAZBoolType( - serialized_name="expressRouteGatewayBypass", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - cls._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - ipsec_policies = _schema_virtual_network_gateway_connection_read.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - cls._build_schema_ipsec_policy_read(ipsec_policies.Element) - - local_network_gateway2 = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - cls._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tunnel_connection_status = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = _schema_virtual_network_gateway_connection_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - cls._build_schema_ipsec_policy_read(vpn_client_ipsec_policies.Element) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/ipsec_policy/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/ipsec_policy/_wait.py deleted file mode 100644 index fc9c8ddfd0a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/ipsec_policy/_wait.py +++ /dev/null @@ -1,633 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection ipsec-policy wait", -) -class Wait(AAZWaitCommand): - """Place the CLI in a waiting state until a condition is met. - """ - - _aaz_info = { - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}", "2018-11-01", "properties.ipsecPolicies[]"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.connection_name = AAZStrArg( - options=["--connection-name"], - help="Connection name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=False) - return result - - class VirtualNetworkGatewayConnectionsGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _WaitHelper._build_schema_virtual_network_gateway_connection_read(cls._schema_on_200) - - return cls._schema_on_200 - - -class _WaitHelper: - """Helper class for Wait""" - - _schema_address_space_read = None - - @classmethod - def _build_schema_address_space_read(cls, _schema): - if cls._schema_address_space_read is not None: - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - return - - cls._schema_address_space_read = _schema_address_space_read = AAZObjectType() - - address_space_read = _schema_address_space_read - address_space_read.address_prefixes = AAZListType( - serialized_name="addressPrefixes", - ) - - address_prefixes = _schema_address_space_read.address_prefixes - address_prefixes.Element = AAZStrType() - - _schema.address_prefixes = cls._schema_address_space_read.address_prefixes - - _schema_bgp_settings_read = None - - @classmethod - def _build_schema_bgp_settings_read(cls, _schema): - if cls._schema_bgp_settings_read is not None: - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - return - - cls._schema_bgp_settings_read = _schema_bgp_settings_read = AAZObjectType() - - bgp_settings_read = _schema_bgp_settings_read - bgp_settings_read.asn = AAZIntType() - bgp_settings_read.bgp_peering_address = AAZStrType( - serialized_name="bgpPeeringAddress", - ) - bgp_settings_read.peer_weight = AAZIntType( - serialized_name="peerWeight", - ) - - _schema.asn = cls._schema_bgp_settings_read.asn - _schema.bgp_peering_address = cls._schema_bgp_settings_read.bgp_peering_address - _schema.peer_weight = cls._schema_bgp_settings_read.peer_weight - - _schema_ipsec_policy_read = None - - @classmethod - def _build_schema_ipsec_policy_read(cls, _schema): - if cls._schema_ipsec_policy_read is not None: - _schema.dh_group = cls._schema_ipsec_policy_read.dh_group - _schema.ike_encryption = cls._schema_ipsec_policy_read.ike_encryption - _schema.ike_integrity = cls._schema_ipsec_policy_read.ike_integrity - _schema.ipsec_encryption = cls._schema_ipsec_policy_read.ipsec_encryption - _schema.ipsec_integrity = cls._schema_ipsec_policy_read.ipsec_integrity - _schema.pfs_group = cls._schema_ipsec_policy_read.pfs_group - _schema.sa_data_size_kilobytes = cls._schema_ipsec_policy_read.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._schema_ipsec_policy_read.sa_life_time_seconds - return - - cls._schema_ipsec_policy_read = _schema_ipsec_policy_read = AAZObjectType() - - ipsec_policy_read = _schema_ipsec_policy_read - ipsec_policy_read.dh_group = AAZStrType( - serialized_name="dhGroup", - flags={"required": True}, - ) - ipsec_policy_read.ike_encryption = AAZStrType( - serialized_name="ikeEncryption", - flags={"required": True}, - ) - ipsec_policy_read.ike_integrity = AAZStrType( - serialized_name="ikeIntegrity", - flags={"required": True}, - ) - ipsec_policy_read.ipsec_encryption = AAZStrType( - serialized_name="ipsecEncryption", - flags={"required": True}, - ) - ipsec_policy_read.ipsec_integrity = AAZStrType( - serialized_name="ipsecIntegrity", - flags={"required": True}, - ) - ipsec_policy_read.pfs_group = AAZStrType( - serialized_name="pfsGroup", - flags={"required": True}, - ) - ipsec_policy_read.sa_data_size_kilobytes = AAZIntType( - serialized_name="saDataSizeKilobytes", - flags={"required": True}, - ) - ipsec_policy_read.sa_life_time_seconds = AAZIntType( - serialized_name="saLifeTimeSeconds", - flags={"required": True}, - ) - - _schema.dh_group = cls._schema_ipsec_policy_read.dh_group - _schema.ike_encryption = cls._schema_ipsec_policy_read.ike_encryption - _schema.ike_integrity = cls._schema_ipsec_policy_read.ike_integrity - _schema.ipsec_encryption = cls._schema_ipsec_policy_read.ipsec_encryption - _schema.ipsec_integrity = cls._schema_ipsec_policy_read.ipsec_integrity - _schema.pfs_group = cls._schema_ipsec_policy_read.pfs_group - _schema.sa_data_size_kilobytes = cls._schema_ipsec_policy_read.sa_data_size_kilobytes - _schema.sa_life_time_seconds = cls._schema_ipsec_policy_read.sa_life_time_seconds - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - - _schema_virtual_network_gateway_connection_read = None - - @classmethod - def _build_schema_virtual_network_gateway_connection_read(cls, _schema): - if cls._schema_virtual_network_gateway_connection_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - return - - cls._schema_virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read = AAZObjectType() - - virtual_network_gateway_connection_read = _schema_virtual_network_gateway_connection_read - virtual_network_gateway_connection_read.etag = AAZStrType() - virtual_network_gateway_connection_read.id = AAZStrType() - virtual_network_gateway_connection_read.location = AAZStrType() - virtual_network_gateway_connection_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_connection_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_connection_read.tags = AAZDictType() - virtual_network_gateway_connection_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.connection_protocol = AAZStrType( - serialized_name="connectionProtocol", - ) - properties.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - properties.connection_type = AAZStrType( - serialized_name="connectionType", - flags={"required": True}, - ) - properties.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.express_route_gateway_bypass = AAZBoolType( - serialized_name="expressRouteGatewayBypass", - ) - properties.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - properties.ipsec_policies = AAZListType( - serialized_name="ipsecPolicies", - ) - properties.local_network_gateway2 = AAZObjectType( - serialized_name="localNetworkGateway2", - ) - properties.peer = AAZObjectType() - cls._build_schema_sub_resource_read(properties.peer) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.routing_weight = AAZIntType( - serialized_name="routingWeight", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.tunnel_connection_status = AAZListType( - serialized_name="tunnelConnectionStatus", - flags={"read_only": True}, - ) - properties.use_policy_based_traffic_selectors = AAZBoolType( - serialized_name="usePolicyBasedTrafficSelectors", - ) - properties.virtual_network_gateway1 = AAZObjectType( - serialized_name="virtualNetworkGateway1", - flags={"required": True}, - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway1) - properties.virtual_network_gateway2 = AAZObjectType( - serialized_name="virtualNetworkGateway2", - ) - cls._build_schema_virtual_network_gateway_read(properties.virtual_network_gateway2) - - ipsec_policies = _schema_virtual_network_gateway_connection_read.properties.ipsec_policies - ipsec_policies.Element = AAZObjectType() - cls._build_schema_ipsec_policy_read(ipsec_policies.Element) - - local_network_gateway2 = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2 - local_network_gateway2.etag = AAZStrType() - local_network_gateway2.id = AAZStrType() - local_network_gateway2.location = AAZStrType() - local_network_gateway2.name = AAZStrType( - flags={"read_only": True}, - ) - local_network_gateway2.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - local_network_gateway2.tags = AAZDictType() - local_network_gateway2.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.properties - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.gateway_ip_address = AAZStrType( - serialized_name="gatewayIpAddress", - ) - properties.local_network_address_space = AAZObjectType( - serialized_name="localNetworkAddressSpace", - ) - cls._build_schema_address_space_read(properties.local_network_address_space) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - - tags = _schema_virtual_network_gateway_connection_read.properties.local_network_gateway2.tags - tags.Element = AAZStrType() - - tunnel_connection_status = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status - tunnel_connection_status.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_connection_read.properties.tunnel_connection_status.Element - _element.connection_status = AAZStrType( - serialized_name="connectionStatus", - flags={"read_only": True}, - ) - _element.egress_bytes_transferred = AAZIntType( - serialized_name="egressBytesTransferred", - flags={"read_only": True}, - ) - _element.ingress_bytes_transferred = AAZIntType( - serialized_name="ingressBytesTransferred", - flags={"read_only": True}, - ) - _element.last_connection_established_utc_time = AAZStrType( - serialized_name="lastConnectionEstablishedUtcTime", - flags={"read_only": True}, - ) - _element.tunnel = AAZStrType( - flags={"read_only": True}, - ) - - tags = _schema_virtual_network_gateway_connection_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_connection_read.etag - _schema.id = cls._schema_virtual_network_gateway_connection_read.id - _schema.location = cls._schema_virtual_network_gateway_connection_read.location - _schema.name = cls._schema_virtual_network_gateway_connection_read.name - _schema.properties = cls._schema_virtual_network_gateway_connection_read.properties - _schema.tags = cls._schema_virtual_network_gateway_connection_read.tags - _schema.type = cls._schema_virtual_network_gateway_connection_read.type - - _schema_virtual_network_gateway_read = None - - @classmethod - def _build_schema_virtual_network_gateway_read(cls, _schema): - if cls._schema_virtual_network_gateway_read is not None: - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - return - - cls._schema_virtual_network_gateway_read = _schema_virtual_network_gateway_read = AAZObjectType() - - virtual_network_gateway_read = _schema_virtual_network_gateway_read - virtual_network_gateway_read.etag = AAZStrType() - virtual_network_gateway_read.id = AAZStrType() - virtual_network_gateway_read.location = AAZStrType() - virtual_network_gateway_read.name = AAZStrType( - flags={"read_only": True}, - ) - virtual_network_gateway_read.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - virtual_network_gateway_read.tags = AAZDictType() - virtual_network_gateway_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties - properties.active_active = AAZBoolType( - serialized_name="activeActive", - ) - properties.bgp_settings = AAZObjectType( - serialized_name="bgpSettings", - ) - cls._build_schema_bgp_settings_read(properties.bgp_settings) - properties.enable_bgp = AAZBoolType( - serialized_name="enableBgp", - ) - properties.gateway_default_site = AAZObjectType( - serialized_name="gatewayDefaultSite", - ) - cls._build_schema_sub_resource_read(properties.gateway_default_site) - properties.gateway_type = AAZStrType( - serialized_name="gatewayType", - ) - properties.ip_configurations = AAZListType( - serialized_name="ipConfigurations", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.resource_guid = AAZStrType( - serialized_name="resourceGuid", - ) - properties.sku = AAZObjectType() - properties.vpn_client_configuration = AAZObjectType( - serialized_name="vpnClientConfiguration", - ) - properties.vpn_type = AAZStrType( - serialized_name="vpnType", - ) - - ip_configurations = _schema_virtual_network_gateway_read.properties.ip_configurations - ip_configurations.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.ip_configurations.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.ip_configurations.Element.properties - properties.private_ip_allocation_method = AAZStrType( - serialized_name="privateIPAllocationMethod", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_ip_address = AAZObjectType( - serialized_name="publicIPAddress", - ) - cls._build_schema_sub_resource_read(properties.public_ip_address) - properties.subnet = AAZObjectType() - cls._build_schema_sub_resource_read(properties.subnet) - - sku = _schema_virtual_network_gateway_read.properties.sku - sku.capacity = AAZIntType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - vpn_client_configuration = _schema_virtual_network_gateway_read.properties.vpn_client_configuration - vpn_client_configuration.radius_server_address = AAZStrType( - serialized_name="radiusServerAddress", - ) - vpn_client_configuration.radius_server_secret = AAZStrType( - serialized_name="radiusServerSecret", - ) - vpn_client_configuration.vpn_client_address_pool = AAZObjectType( - serialized_name="vpnClientAddressPool", - ) - cls._build_schema_address_space_read(vpn_client_configuration.vpn_client_address_pool) - vpn_client_configuration.vpn_client_ipsec_policies = AAZListType( - serialized_name="vpnClientIpsecPolicies", - ) - vpn_client_configuration.vpn_client_protocols = AAZListType( - serialized_name="vpnClientProtocols", - ) - vpn_client_configuration.vpn_client_revoked_certificates = AAZListType( - serialized_name="vpnClientRevokedCertificates", - ) - vpn_client_configuration.vpn_client_root_certificates = AAZListType( - serialized_name="vpnClientRootCertificates", - ) - - vpn_client_ipsec_policies = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_ipsec_policies - vpn_client_ipsec_policies.Element = AAZObjectType() - cls._build_schema_ipsec_policy_read(vpn_client_ipsec_policies.Element) - - vpn_client_protocols = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_protocols - vpn_client_protocols.Element = AAZStrType() - - vpn_client_revoked_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates - vpn_client_revoked_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_revoked_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.thumbprint = AAZStrType() - - vpn_client_root_certificates = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates - vpn_client_root_certificates.Element = AAZObjectType() - - _element = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element - _element.etag = AAZStrType() - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"required": True, "client_flatten": True}, - ) - - properties = _schema_virtual_network_gateway_read.properties.vpn_client_configuration.vpn_client_root_certificates.Element.properties - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.public_cert_data = AAZStrType( - serialized_name="publicCertData", - flags={"required": True}, - ) - - tags = _schema_virtual_network_gateway_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_virtual_network_gateway_read.etag - _schema.id = cls._schema_virtual_network_gateway_read.id - _schema.location = cls._schema_virtual_network_gateway_read.location - _schema.name = cls._schema_virtual_network_gateway_read.name - _schema.properties = cls._schema_virtual_network_gateway_read.properties - _schema.tags = cls._schema_virtual_network_gateway_read.tags - _schema.type = cls._schema_virtual_network_gateway_read.type - - -__all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/shared_key/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/shared_key/__cmd_group.py deleted file mode 100644 index 578d7fccf42..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/shared_key/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 vpn-connection shared-key", -) -class __CMDGroup(AAZCommandGroup): - """Manage VPN shared keys. - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/shared_key/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/shared_key/__init__.py deleted file mode 100644 index c7524bb868c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/shared_key/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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 ._reset import * -from ._show import * -from ._update import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/shared_key/_reset.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/shared_key/_reset.py deleted file mode 100644 index 7ae54e42a6f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/shared_key/_reset.py +++ /dev/null @@ -1,211 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection shared-key reset", -) -class Reset(AAZCommand): - """Reset a VPN connection shared key. - - :example: Reset the shared key on a connection. - az network vpn-connection shared-key reset -g MyResourceGroup --connection-name MyConnection --key-length 128 - - :example: Reset a VPN connection shared key. - az network vpn-connection shared-key reset --connection-name MyConnection --key-length 128 --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}/sharedkey/reset", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.connection_name = AAZStrArg( - options=["--connection-name"], - help="Connection name.", - required=True, - id_part="name", - ) - _args_schema.key_length = AAZIntArg( - options=["--key-length"], - help="The virtual network connection reset shared key length, should between 1 and 128.", - required=True, - fmt=AAZIntArgFormat( - maximum=128, - minimum=1, - ), - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - yield self.VirtualNetworkGatewayConnectionsResetSharedKey(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewayConnectionsResetSharedKey(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200, - self.on_error, - lro_options={"final-state-via": "location"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("keyLength", AAZIntType, ".key_length", typ_kwargs={"flags": {"required": True}}) - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.key_length = AAZIntType( - serialized_name="keyLength", - flags={"required": True}, - ) - - return cls._schema_on_200 - - -class _ResetHelper: - """Helper class for Reset""" - - -__all__ = ["Reset"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/shared_key/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/shared_key/_show.py deleted file mode 100644 index 265c6136b9f..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/shared_key/_show.py +++ /dev/null @@ -1,171 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection shared-key show", -) -class Show(AAZCommand): - """Retrieve a VPN connection shared key. - - :example: View the shared key of a connection. - az network vpn-connection shared-key show -g MyResourceGroup --connection-name MyConnection - - :example: Retrieve a VPN connection shared key. - az network vpn-connection shared-key show --connection-name MyConnection --resource-group MyResourceGroup --subscription MySubscription - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}/sharedkey", "2018-11-01"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.connection_name = AAZStrArg( - options=["--connection-name"], - help="Connection name.", - required=True, - id_part="name", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGetSharedKey(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewayConnectionsGetSharedKey(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.id = AAZStrType() - _schema_on_200.value = AAZStrType( - flags={"required": True}, - ) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/shared_key/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/shared_key/_update.py deleted file mode 100644 index a66ca2dfb84..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/profile_2020_09_01_hybrid/network/vpn_connection/shared_key/_update.py +++ /dev/null @@ -1,340 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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( - "network vpn-connection shared-key update", -) -class Update(AAZCommand): - """Update a VPN connection shared key. - - :example: Change the shared key for the connection to "Abc123". - az network vpn-connection shared-key update -g MyResourceGroup --connection-name MyConnection --value Abc123 - - :example: Update a VPN connection shared key. - az network vpn-connection shared-key update --connection-name MyConnection --resource-group MyResourceGroup --subscription MySubscription --value Abc123 - """ - - _aaz_info = { - "version": "2018-11-01", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/connections/{}/sharedkey", "2018-11-01"], - ] - } - - AZ_SUPPORT_NO_WAIT = True - - AZ_SUPPORT_GENERIC_UPDATE = True - - def _handler(self, command_args): - super()._handler(command_args) - return self.build_lro_poller(self._execute_operations, self._output) - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.connection_name = AAZStrArg( - options=["--connection-name"], - help="Connection name.", - required=True, - id_part="name", - ) - _args_schema.value = AAZStrArg( - options=["--value"], - help="The virtual network connection shared key value.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.VirtualNetworkGatewayConnectionsGetSharedKey(ctx=self.ctx)() - self.pre_instance_update(self.ctx.vars.instance) - self.InstanceUpdateByJson(ctx=self.ctx)() - self.InstanceUpdateByGeneric(ctx=self.ctx)() - self.post_instance_update(self.ctx.vars.instance) - yield self.VirtualNetworkGatewayConnectionsSetSharedKey(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - @register_callback - def pre_instance_update(self, instance): - pass - - @register_callback - def post_instance_update(self, instance): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class VirtualNetworkGatewayConnectionsGetSharedKey(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_connection_shared_key_read(cls._schema_on_200) - - return cls._schema_on_200 - - class VirtualNetworkGatewayConnectionsSetSharedKey(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [202]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - if session.http_response.status_code in [200, 201]: - return self.client.build_lro_polling( - self.ctx.args.no_wait, - session, - self.on_200_201, - self.on_error, - lro_options={"final-state-via": "azure-async-operation"}, - path_format_arguments=self.url_parameters, - ) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "MgmtErrorFormat" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - **self.serialize_url_param( - "virtualNetworkGatewayConnectionName", self.ctx.args.connection_name, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2018-11-01", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - value=self.ctx.vars.instance, - ) - - return self.serialize_content(_content_value) - - def on_200_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200_201 - ) - - _schema_on_200_201 = None - - @classmethod - def _build_schema_on_200_201(cls): - if cls._schema_on_200_201 is not None: - return cls._schema_on_200_201 - - cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_connection_shared_key_read(cls._schema_on_200_201) - - return cls._schema_on_200_201 - - class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance(self.ctx.vars.instance) - - def _update_instance(self, instance): - _instance_value, _builder = self.new_content_builder( - self.ctx.args, - value=instance, - typ=AAZObjectType - ) - _builder.set_prop("value", AAZStrType, ".value", typ_kwargs={"flags": {"required": True}}) - - return _instance_value - - class InstanceUpdateByGeneric(AAZGenericInstanceUpdateOperation): - - def __call__(self, *args, **kwargs): - self._update_instance_by_generic( - self.ctx.vars.instance, - self.ctx.generic_update_args - ) - - -class _UpdateHelper: - """Helper class for Update""" - - _schema_connection_shared_key_read = None - - @classmethod - def _build_schema_connection_shared_key_read(cls, _schema): - if cls._schema_connection_shared_key_read is not None: - _schema.id = cls._schema_connection_shared_key_read.id - _schema.value = cls._schema_connection_shared_key_read.value - return - - cls._schema_connection_shared_key_read = _schema_connection_shared_key_read = AAZObjectType() - - connection_shared_key_read = _schema_connection_shared_key_read - connection_shared_key_read.id = AAZStrType() - connection_shared_key_read.value = AAZStrType( - flags={"required": True}, - ) - - _schema.id = cls._schema_connection_shared_key_read.id - _schema.value = cls._schema_connection_shared_key_read.value - - -__all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/__init__.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/__init__.py deleted file mode 100644 index 34913fb394d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_actions.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/_actions.py deleted file mode 100644 index a26ec84e633..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_actions.py +++ /dev/null @@ -1,39 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -from collections import defaultdict - -import argparse -from azure.cli.core.azclierror import UnrecognizedArgumentError - - -def _split(param): - return param.split(',') - - -class AddMappingRequest(argparse.Action): - def __call__(self, parser, namespace, values, option_string=None): - action = self.get_action(values, option_string) - namespace.request = action - - def get_action(self, values, option_string): # pylint: disable=no-self-use - try: - properties = defaultdict(list) - for (k, v) in (x.split('=', 1) for x in values): - properties[k].append(v) - properties = dict(properties) - except ValueError: - raise UnrecognizedArgumentError('Usage error: {} [KEY=VALUE ...]'.format(option_string)) - d = {} - for k in properties: - kl = k.lower() - v = properties[k] - if kl == 'ip': - d['ip_address'] = v[0] - elif kl == 'nic': - d['ip_configuration'] = v[0] - else: - raise UnrecognizedArgumentError('key error: key must be one of {ip, nic}.') - return d diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_client_factory.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/_client_factory.py deleted file mode 100644 index bf416c2ec9a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_client_factory.py +++ /dev/null @@ -1,34 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -def network_client_factory(cli_ctx, **kwargs): - from azure.cli.core.profiles import ResourceType - from azure.cli.core.commands.client_factory import get_mgmt_service_client - return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_NETWORK, **kwargs) - - -def resource_client_factory(cli_ctx, **_): - from azure.cli.core.profiles import ResourceType - from azure.cli.core.commands.client_factory import get_mgmt_service_client - return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES) - - -def cf_dns_references(cli_ctx, _): - from azure.cli.core.profiles import ResourceType - from azure.cli.core.commands.client_factory import get_mgmt_service_client - return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_NETWORK_DNS).dns_resource_reference - - -def cf_dns_mgmt_zones(cli_ctx, _): - from azure.cli.core.profiles import ResourceType - from azure.cli.core.commands.client_factory import get_mgmt_service_client - return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_NETWORK_DNS).zones - - -def cf_dns_mgmt_record_sets(cli_ctx, _): - from azure.cli.core.profiles import ResourceType - from azure.cli.core.commands.client_factory import get_mgmt_service_client - return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_NETWORK_DNS).record_sets diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_completers.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/_completers.py deleted file mode 100644 index 0ddaf25f533..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_completers.py +++ /dev/null @@ -1,34 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -from azure.cli.core.decorators import Completer - -from azure.cli.command_modules.network.azure_stack._client_factory import network_client_factory - - -# pylint: disable=inconsistent-return-statements -@Completer -def subnet_completion_list(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument - client = network_client_factory(cmd.cli_ctx) - if namespace.resource_group_name and namespace.virtual_network_name: - rg = namespace.resource_group_name - vnet = namespace.virtual_network_name - return [r.name for r in client.subnets.list(resource_group_name=rg, virtual_network_name=vnet)] - - -def get_lb_subresource_completion_list(prop): - - # pylint: disable=inconsistent-return-statements - @Completer - def completer(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument - client = network_client_factory(cmd.cli_ctx) - try: - lb_name = namespace.load_balancer_name - except AttributeError: - lb_name = namespace.resource_name - if namespace.resource_group_name and lb_name: - lb = client.load_balancers.get(namespace.resource_group_name, lb_name) - return [r.name for r in getattr(lb, prop)] - return completer diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_format.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/_format.py deleted file mode 100644 index 74844f7d79a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_format.py +++ /dev/null @@ -1,209 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -from collections import OrderedDict - - -def transform_dns_record_set_output(result): - from azure.mgmt.dns.models import RecordSetListResult - - def _strip_null_records(item): - for prop in [x for x in dir(item) if 'record' in x]: - if not getattr(item, prop): - delattr(item, prop) - - if isinstance(result, RecordSetListResult): - result = list(result) - for item in result: - _strip_null_records(item) - else: - _strip_null_records(result) - - return result - - -def transform_dns_record_set_table_output(result): - table_output = [] - - for item in result: - table_row = OrderedDict() - table_row['Name'] = item['name'] - table_row['ResourceGroup'] = item['resourceGroup'] - table_row['Ttl'] = item['ttl'] - table_row['Type'] = item['type'].rsplit('/', 1)[1] - metadata = item['metadata'] - if metadata: - table_row['Metadata'] = ' '.join(['{}="{}"'.format(x, metadata[x]) for x in sorted(metadata)]) - else: - table_row['Metadata'] = ' ' - table_output.append(table_row) - return table_output - - -def transform_dns_zone_table_output(result): - is_list = isinstance(result, list) - - if not is_list: - result = [result] - - final_result = [] - for item in result: - new_item = OrderedDict([ - ('ZoneName', item['name']), - ('ResourceGroup', item['resourceGroup']), - ('RecordSets', item['numberOfRecordSets']), - ('MaxRecordSets', item['maxNumberOfRecordSets']) - ]) - final_result.append(new_item) - - return final_result if is_list else final_result[0] - - -def transform_local_gateway_table_output(result): - final_result = [] - for item in result: - new_item = OrderedDict([ - ('Name', item['name']), ('Location', item['location']), - ('ResourceGroup', item['resourceGroup']), - ('ProvisioningState', item['provisioningState']), - ('GatewayIpAddress', item['gatewayIpAddress']) - ]) - try: - local_prefixes = item['localNetworkAddressSpace']['addressPrefixes'] or [' '] - except TypeError: - local_prefixes = [' '] - prefix_val = '{}{}'.format(local_prefixes[0], ', ...' if len(local_prefixes) > 1 else '') - new_item['AddressPrefixes'] = prefix_val - final_result.append(new_item) - return final_result - - -def transform_vnet_table_output(result): - - def _transform(result): - item = OrderedDict() - item['Name'] = result['name'] - item['ResourceGroup'] = result['resourceGroup'] - item['Location'] = result['location'] - item['NumSubnets'] = len(result.get('subnets', [])) - item['Prefixes'] = ', '.join(result['addressSpace']['addressPrefixes']) or ' ' - item['DnsServers'] = ', '.join((result.get('dhcpOptions') or {}).get('dnsServers', [])) or ' ' - item['DDOSProtection'] = result['enableDdosProtection'] - item['VMProtection'] = result['enableVmProtection'] - return item - if isinstance(result, list): - return [_transform(r) for r in result] - return _transform(result) - - -def transform_public_ip_create_output(result): - return {'publicIp': result.result()} - - -def transform_nsg_rule_table_output(result): - item = OrderedDict() - item['Name'] = result['name'] - item['ResourceGroup'] = result['resourceGroup'] - item['Priority'] = result['priority'] - item['Access'] = result['access'] - item['Protocol'] = result['protocol'] - item['Direction'] = result['direction'] - if 'SourcePortRanges' in result: - item['SourcePortRanges'] = result.get('sourcePortRange', ' '.join(result['sourcePortRanges'])) - if 'SourceAddressPrefixes' in result: - item['SourceAddressPrefixes'] = result.get('sourceAddressPrefix', ' '.join(result['sourceAddressPrefixes'])) - if 'SourceASG' in result: - item['SourceASG'] = result.get('sourceApplicationSecurityGroups', 'None') - if 'DestinationPortRanges' in result: - item['DestinationPortRanges'] = result.get('destinationPortRange', ' '.join(result['destinationPortRanges'])) - if 'DestinationAddressPrefixes' in result: - item['DestinationAddressPrefixes'] = result.get('destinationAddressPrefix', - ' '.join(result['destinationAddressPrefixes'])) - if 'DestinationASG' in result: - item['DestinationASG'] = result.get('destinationApplicationSecurityGroups', 'None') - return item - - -def transform_network_usage_table(result): - transformed = [] - for item in result: - transformed.append(OrderedDict([ - ('Name', item['localName']), - ('CurrentValue', item['currentValue']), - ('Limit', item['limit']) - ])) - return transformed - - -def transform_effective_route_table(result): - transformed = [] - for item in result['value']: - transformed.append(OrderedDict([ - ('Source', item['source']), - ('State', item['state']), - ('Address Prefix', ' '.join(item['addressPrefix'] or [])), - ('Next Hop Type', item['nextHopType']), - ('Next Hop IP', ' '.join(item['nextHopIpAddress'] or [])) - ])) - return transformed - - -def transform_effective_nsg(result): - from azure.mgmt.core.tools import parse_resource_id - transformed = [] - for item in result['value']: - association = item['association'] - try: - nic = parse_resource_id(association['networkInterface']['id'])['name'] - except TypeError: - nic = '-' - try: - subnet = parse_resource_id(association['subnet']['id'])['name'] - except TypeError: - subnet = '-' - nsg = parse_resource_id(item['networkSecurityGroup']['id'])['name'] - print_names = True - for rule in item['effectiveSecurityRules']: - transformed.append(OrderedDict([ - ('NIC', nic if print_names else ' '), - ('Subnet', subnet if print_names else ' '), - ('NSG', nsg if print_names else ' '), - ('Rule Name', rule.get('name', '')), - ('Protocol', rule.get('protocol', '')), - ('Direction', rule.get('direction', '')), - ('Access', rule.get('access', '')) - ])) - print_names = False - return transformed - - -def transform_vnet_gateway_routes_table(result): - transformed = [] - for item in result.get('value', []): - transformed.append(OrderedDict([ - ('Network', item.get('network', '')), - ('NextHop', item.get('nextHop', '')), - ('Origin', item.get('origin', '')), - ('SourcePeer', item.get('sourcePeer', '')), - ('AsPath', item.get('asPath', '')), - ('Weight', item.get('weight', '')) - ])) - return transformed - - -def transform_vnet_gateway_bgp_peer_table(result): - transformed = [] - for item in result.get('value', []): - transformed.append(OrderedDict([ - ('Neighbor', item.get('neighbor', '')), - ('ASN', item.get('asn', '')), - ('State', item.get('state', '')), - ('ConnectedDuration', item.get('connectedDuration', '')), - ('RoutesReceived', item.get('routesReceived', '')), - ('MessagesSent', item.get('messagesSent', '')), - ('MessagesReceived', item.get('messagesReceived', '')) - ])) - return transformed diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_params.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/_params.py deleted file mode 100644 index 6de52b9893b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_params.py +++ /dev/null @@ -1,354 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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, too-many-lines -from argcomplete.completers import FilesCompleter - -from knack.arguments import CLIArgumentType, ignore_type - -from azure.cli.core.commands.parameters import (get_location_type, get_resource_name_completion_list, - tags_type, zone_type, file_type, - get_three_state_flag, get_enum_type) -from azure.cli.core.commands.validators import get_default_location_from_resource_group -from azure.cli.core.commands.template_create import get_folded_parameter_help_string -from azure.cli.core.local_context import LocalContextAttribute, LocalContextAction -from azure.cli.command_modules.network.azure_stack._validators import ( - dns_zone_name_type, - validate_address_pool_name_or_id, validate_metadata, - validate_dns_record_type, - validate_private_ip_address, - get_vnet_validator, validate_ip_tags, validate_ddos_name_or_id, - validate_subresource_list, - process_private_link_resource_id_argument, process_private_endpoint_connection_id_argument) -from azure.cli.command_modules.network.azure_stack._completers import ( - subnet_completion_list, get_lb_subresource_completion_list) -from azure.cli.command_modules.network.azure_stack._actions import ( - AddMappingRequest) -from azure.cli.core.profiles import ResourceType - - -# pylint: disable=too-many-locals, too-many-branches, too-many-statements -def load_arguments(self, _): - - ZoneType = self.get_models('ZoneType', resource_type=ResourceType.MGMT_NETWORK_DNS) - - # taken from Xplat. No enums in SDK - - name_arg_type = CLIArgumentType(options_list=['--name', '-n'], metavar='NAME') - nic_type = CLIArgumentType(options_list='--nic-name', metavar='NAME', help='The network interface (NIC).', id_part='name', completer=get_resource_name_completion_list('Microsoft.Network/networkInterfaces')) - nsg_name_type = CLIArgumentType(options_list='--nsg-name', metavar='NAME', help='Name of the network security group.') - virtual_network_name_type = CLIArgumentType(options_list='--vnet-name', metavar='NAME', help='The virtual network (VNet) name.', completer=get_resource_name_completion_list('Microsoft.Network/virtualNetworks'), - local_context_attribute=LocalContextAttribute(name='vnet_name', actions=[LocalContextAction.GET])) - subnet_name_type = CLIArgumentType(options_list='--subnet-name', metavar='NAME', help='The subnet name.', - local_context_attribute=LocalContextAttribute(name='subnet_name', actions=[LocalContextAction.GET])) - load_balancer_name_type = CLIArgumentType(options_list='--lb-name', metavar='NAME', help='The load balancer name.', completer=get_resource_name_completion_list('Microsoft.Network/loadBalancers'), id_part='name') - private_ip_address_type = CLIArgumentType(help='Static private IP address to use.', validator=validate_private_ip_address) - app_gateway_name_type = CLIArgumentType(help='Name of the application gateway.', options_list='--gateway-name', completer=get_resource_name_completion_list('Microsoft.Network/applicationGateways'), id_part='name') - zone_compatible_type = CLIArgumentType( - options_list=['--zone', '-z'], - nargs='+', - help='Space-separated list of availability zones into which to provision the resource.', - choices=['1', '2', '3'] - ) - edge_zone = CLIArgumentType(help='The name of edge zone.', is_preview=True, min_api='2021-02-01') - - # region NetworkRoot - with self.argument_context('network') as c: - c.argument('subnet_name', subnet_name_type) - c.argument('virtual_network_name', virtual_network_name_type, id_part='name') - c.argument('tags', tags_type) - c.argument('network_security_group_name', nsg_name_type, id_part='name') - c.argument('private_ip_address', private_ip_address_type) - c.argument('private_ip_address_version', arg_type=get_enum_type(["IPv4", "IPv6"])) - c.argument('enable_tcp_reset', arg_type=get_three_state_flag(), help='Receive bidirectional TCP reset on TCP flow idle timeout or unexpected connection termination. Only used when protocol is set to TCP.', min_api='2018-07-01') - c.argument('location', get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) - c.argument('cache_result', arg_type=get_enum_type(['in', 'out', 'inout']), options_list='--cache', help='Cache the JSON object instead of sending off immediately.') - # endregion - - # region DNS - with self.argument_context('network dns') as c: - c.argument('record_set_name', name_arg_type, help='The name of the record set, relative to the name of the zone.') - c.argument('relative_record_set_name', name_arg_type, help='The name of the record set, relative to the name of the zone.') - c.argument('zone_name', options_list=['--zone-name', '-z'], help='The name of the zone.', type=dns_zone_name_type) - c.argument('metadata', nargs='+', help='Metadata in space-separated key=value pairs. This overwrites any existing metadata.', validator=validate_metadata) - - with self.argument_context('network dns list-references') as c: - c.argument('target_resources', nargs='+', min_api='2018-05-01', help='Space-separated list of resource IDs you wish to query.', validator=validate_subresource_list) - - with self.argument_context('network dns zone') as c: - c.argument('zone_name', name_arg_type) - c.ignore('location') - - c.argument('zone_type', help='Type of DNS zone to create.', deprecate_info=c.deprecate(), arg_type=get_enum_type(ZoneType)) - - c.argument('registration_vnets', - arg_group='Private Zone', - nargs='+', - help='Space-separated names or IDs of virtual networks that register hostnames in this DNS zone. ' - 'Number of private DNS zones with virtual network auto-registration enabled is 1. ' - 'If you need to increase this limit, please contact Azure Support: ' - 'https://learn.microsoft.com/en-us/azure/azure-subscription-service-limits', - validator=get_vnet_validator('registration_vnets')) - c.argument('resolution_vnets', - arg_group='Private Zone', - nargs='+', - help='Space-separated names or IDs of virtual networks that resolve records in this DNS zone.', - validator=get_vnet_validator('resolution_vnets')) - - with self.argument_context('network dns zone import') as c: - c.argument('file_name', options_list=['--file-name', '-f'], type=file_type, completer=FilesCompleter(), help='Path to the DNS zone file to import') - - with self.argument_context('network dns zone export') as c: - c.argument('file_name', options_list=['--file-name', '-f'], type=file_type, completer=FilesCompleter(), help='Path to the DNS zone file to save') - - with self.argument_context('network dns zone update') as c: - c.ignore('if_none_match') - - with self.argument_context('network dns zone create') as c: - c.argument('parent_zone_name', options_list=['--parent-name', '-p'], help='Specify if parent zone exists for this zone and delegation for the child zone in the parent is to be added.') - - with self.argument_context('network dns record-set') as c: - c.argument('target_resource', min_api='2018-05-01', help='ID of an Azure resource from which the DNS resource value is taken.') - for item in ['record_type', 'record_set_type']: - c.argument(item, ignore_type, validator=validate_dns_record_type) - - for item in ['', 'a', 'aaaa', 'caa', 'cname', 'mx', 'ns', 'ptr', 'srv', 'txt']: - with self.argument_context('network dns record-set {} create'.format(item)) as c: - c.argument('ttl', help='Record set TTL (time-to-live)') - c.argument('if_none_match', help='Create the record set only if it does not already exist.', action='store_true') - - for item in ['a', 'aaaa', 'caa', 'cname', 'mx', 'ns', 'ptr', 'srv', 'txt']: - with self.argument_context('network dns record-set {} add-record'.format(item)) as c: - c.argument('ttl', type=int, help='Record set TTL (time-to-live)') - c.argument('record_set_name', - options_list=['--record-set-name', '-n'], - help='The name of the record set relative to the zone. ' - 'Creates a new record set if one does not exist.') - c.argument('if_none_match', help='Create the record set only if it does not already exist.', - action='store_true') - - with self.argument_context('network dns record-set {} remove-record'.format(item)) as c: - c.argument('record_set_name', options_list=['--record-set-name', '-n'], help='The name of the record set relative to the zone.') - c.argument('keep_empty_record_set', action='store_true', help='Keep the empty record set if the last record is removed.') - - with self.argument_context('network dns record-set cname set-record') as c: - c.argument('record_set_name', options_list=['--record-set-name', '-n'], help='The name of the record set relative to the zone. Creates a new record set if one does not exist.') - c.argument('ttl', help='Record set TTL (time-to-live)') - c.argument('if_none_match', help='Create the record set only if it does not already exist.', - action='store_true') - - with self.argument_context('network dns record-set soa') as c: - c.argument('relative_record_set_name', ignore_type, default='@') - c.argument('if_none_match', help='Create the record set only if it does not already exist.', - action='store_true') - - with self.argument_context('network dns record-set a') as c: - c.argument('ipv4_address', options_list=['--ipv4-address', '-a'], help='IPv4 address in string notation.') - - with self.argument_context('network dns record-set aaaa') as c: - c.argument('ipv6_address', options_list=['--ipv6-address', '-a'], help='IPv6 address in string notation.') - - with self.argument_context('network dns record-set caa') as c: - c.argument('value', help='Value of the CAA record.') - c.argument('flags', help='Integer flags for the record.', type=int) - c.argument('tag', help='Record tag') - - with self.argument_context('network dns record-set cname') as c: - c.argument('cname', options_list=['--cname', '-c'], help='Value of the cname record-set. It should be Canonical name.') - - with self.argument_context('network dns record-set mx') as c: - c.argument('exchange', options_list=['--exchange', '-e'], help='Exchange metric.') - c.argument('preference', options_list=['--preference', '-p'], help='Preference metric.') - - with self.argument_context('network dns record-set ns') as c: - c.argument('dname', options_list=['--nsdname', '-d'], help='Name server domain name.') - - with self.argument_context('network dns record-set ns add-record') as c: - c.argument('subscription_id', options_list=['--subscriptionid', '-s'], help='Subscription id to add name server record') - c.ignore('_subscription') - - with self.argument_context('network dns record-set ptr') as c: - c.argument('dname', options_list=['--ptrdname', '-d'], help='PTR target domain name.') - - with self.argument_context('network dns record-set soa') as c: - c.argument('host', options_list=['--host', '-t'], help='Host name.') - c.argument('email', options_list=['--email', '-e'], help='Email address.') - c.argument('expire_time', options_list=['--expire-time', '-x'], help='Expire time (seconds).') - c.argument('minimum_ttl', options_list=['--minimum-ttl', '-m'], help='Minimum TTL (time-to-live, seconds).') - c.argument('refresh_time', options_list=['--refresh-time', '-f'], help='Refresh value (seconds).') - c.argument('retry_time', options_list=['--retry-time', '-r'], help='Retry time (seconds).') - c.argument('serial_number', options_list=['--serial-number', '-s'], help='Serial number.') - - with self.argument_context('network dns record-set srv') as c: - c.argument('priority', type=int, options_list=['--priority', '-p'], help='Priority metric.') - c.argument('weight', type=int, options_list=['--weight', '-w'], help='Weight metric.') - c.argument('port', type=int, options_list=['--port', '-r'], help='Service port.') - c.argument('target', options_list=['--target', '-t'], help='Target domain name.') - - with self.argument_context('network dns record-set txt') as c: - c.argument('value', options_list=['--value', '-v'], nargs='+', help='Space-separated list of text values which will be concatenated together.') - - # endregion - - # region LoadBalancers - with self.argument_context('network lb') as c: - c.argument('load_balancer_name', load_balancer_name_type, options_list=['--name', '-n']) - c.argument('frontend_port', help='Port number') - c.argument('frontend_port_range_start', help='Port number') - c.argument('frontend_port_range_end', help='Port number') - c.argument('backend_port', help='Port number') - c.argument('frontend_ip_name', help='The name of the frontend IP configuration.', completer=get_lb_subresource_completion_list('frontend_ip_configurations')) - c.argument('floating_ip', help='Enable floating IP.', arg_type=get_three_state_flag()) - c.argument('idle_timeout', help='Idle timeout in minutes.', type=int) - c.argument('protocol', help='Network transport protocol.', arg_type=get_enum_type(["Udp", "Tcp", "All"])) - c.argument('private_ip_address_version', min_api='2019-04-01', help='The private IP address version to use.', default="IPv4") - for item in ['backend_pool_name', 'backend_address_pool_name']: - c.argument(item, options_list='--backend-pool-name', help='The name of the backend address pool.', completer=get_lb_subresource_completion_list('backend_address_pools')) - c.argument('request', help='Query inbound NAT rule port mapping request.', action=AddMappingRequest, nargs='*') - - with self.argument_context('network lb create') as c: - c.argument('frontend_ip_zone', zone_type, min_api='2017-06-01', options_list=['--frontend-ip-zone'], help='used to create internal facing Load balancer') - c.argument('validate', help='Generate and validate the ARM template without creating any resources.', action='store_true') - c.argument('sku', min_api='2017-08-01', help='Load balancer SKU', arg_type=get_enum_type(['Basic', 'Gateway', 'Standard'], default='basic')) - c.argument('edge_zone', edge_zone) - - with self.argument_context('network lb create', arg_group='Public IP') as c: - public_ip_help = get_folded_parameter_help_string('public IP address', allow_none=True, allow_new=True) - c.argument('public_ip_address', help=public_ip_help, completer=get_resource_name_completion_list('Microsoft.Network/publicIPAddresses')) - c.argument('public_ip_address_allocation', help='IP allocation method.', arg_type=get_enum_type(['Static', 'Dynamic'])) - c.argument('public_ip_dns_name', help='Globally unique DNS name for a new public IP.') - c.argument('public_ip_zone', zone_type, min_api='2017-06-01', options_list=['--public-ip-zone'], help='used to created a new public ip for the load balancer, a.k.a public facing Load balancer') - c.ignore('public_ip_address_type') - - with self.argument_context('network lb create', arg_group='Subnet') as c: - subnet_help = get_folded_parameter_help_string('subnet', other_required_option='--vnet-name', allow_new=True, allow_none=True, default_none=True) - c.argument('subnet', help=subnet_help, completer=subnet_completion_list) - c.argument('subnet_address_prefix', help='The CIDR address prefix to use when creating a new subnet.') - c.argument('virtual_network_name', virtual_network_name_type) - c.argument('vnet_address_prefix', help='The CIDR address prefix to use when creating a new VNet.') - c.ignore('vnet_type', 'subnet_type') - # endregion - - # region NetworkInterfaces (NIC) - with self.argument_context('network nic ip-config address-pool') as c: - c.argument('load_balancer_name', options_list='--lb-name', help='The name of the load balancer containing the address pool (Omit if supplying an address pool ID).', completer=get_resource_name_completion_list('Microsoft.Network/loadBalancers')) - c.argument('application_gateway_name', app_gateway_name_type, help='The name of an application gateway containing the address pool (Omit if supplying an address pool ID).', id_part=None) - c.argument('backend_address_pool', options_list='--address-pool', help='The name or ID of an existing backend address pool.', validator=validate_address_pool_name_or_id) - c.argument('ip_config_name', options_list=['--ip-config-name', '-n'], metavar='IP_CONFIG_NAME', help='The name of the IP configuration.', id_part=None) - c.argument('network_interface_name', nic_type, id_part=None) - # endregion - - # region NetworkSecurityGroups - with self.argument_context('network nsg rule') as c: - c.argument('security_rule_name', name_arg_type, id_part='child_name_1', help='Name of the network security group rule') - c.argument('network_security_group_name', options_list='--nsg-name', metavar='NSGNAME', help='Name of the network security group', id_part='name') - c.argument('include_default', help='Include default security rules in the output.') - # endregion - - # region PublicIPAddresses - with self.argument_context('network public-ip') as c: - c.argument('public_ip_address_name', name_arg_type, completer=get_resource_name_completion_list('Microsoft.Network/publicIPAddresses'), id_part='name', help='The name of the public IP address.') - c.argument('name', name_arg_type, completer=get_resource_name_completion_list('Microsoft.Network/publicIPAddresses'), help='The name of the public IP address.') - c.argument('reverse_fqdn', help='Reverse FQDN (fully qualified domain name).') - c.argument('dns_name', help='Globally unique DNS entry.') - c.argument('idle_timeout', type=int, help='Idle timeout in minutes.') - c.argument('zone', zone_type, min_api='2017-06-01', max_api='2020-07-01') - c.argument('zone', zone_compatible_type, min_api='2020-08-01') - c.argument('ip_tags', nargs='+', min_api='2017-11-01', help="Space-separated list of IP tags in 'TYPE=VAL' format.", validator=validate_ip_tags) - c.argument('ip_address', help='The IP address associated with the public IP address resource.') - - with self.argument_context('network public-ip create') as c: - c.argument('name', completer=None) - c.argument('sku', min_api='2017-08-01', help='Name of a public IP address SKU', arg_type=get_enum_type(["Basic", "Standard"])) - c.argument('tier', min_api='2020-07-01', help='Tier of a public IP address SKU and Global tier is only supported for standard SKU public IP addresses', arg_type=get_enum_type(["Regional", "Global"])) - c.ignore('dns_name_type') - c.argument('edge_zone', edge_zone) - - with self.argument_context('network public-ip create') as c: - c.argument('allocation_method', help='IP address allocation method', arg_type=get_enum_type(['Static', 'Dynamic'])) - c.argument('version', min_api='2016-09-01', help='IP address type.', arg_type=get_enum_type(["IPv4", "IPv6"], default='ipv4')) - c.argument('protection_mode', min_api='2022-01-01', help='The DDoS protection mode of the public IP', arg_type=get_enum_type(['Enabled', 'Disabled', 'VirtualNetworkInherited'])) - - for scope in ['public-ip']: - with self.argument_context('network {}'.format(scope), min_api='2018-07-01') as c: - c.argument('public_ip_prefix', help='Name or ID of a public IP prefix.') - # endregion - - # region VirtualNetworks - encryption_policy_types = ['dropUnencrypted', 'allowUnencrypted'] - with self.argument_context('network vnet') as c: - c.argument('virtual_network_name', virtual_network_name_type, options_list=['--name', '-n'], id_part='name') - c.argument('vnet_prefixes', nargs='+', help='Space-separated list of IP address prefixes for the VNet.', options_list='--address-prefixes', metavar='PREFIX') - c.argument('dns_servers', nargs='+', help='Space-separated list of DNS server IP addresses.', metavar='IP') - c.argument('ddos_protection', arg_type=get_three_state_flag(), help='Control whether DDoS protection is enabled.', min_api='2017-09-01') - c.argument('ddos_protection_plan', help='Name or ID of a DDoS protection plan to associate with the VNet.', min_api='2018-02-01', validator=validate_ddos_name_or_id) - c.argument('vm_protection', arg_type=get_three_state_flag(), help='Enable VM protection for all subnets in the VNet.', min_api='2017-09-01') - c.argument('flowtimeout', type=int, help='The FlowTimeout value (in minutes) for the Virtual Network', min_api='2021-02-01', is_preview=True) - c.argument('bgp_community', help='The BGP community associated with the virtual network.') - c.argument('enable_encryption', arg_type=get_three_state_flag(), help='Enable encryption on the virtual network.', min_api='2021-05-01', is_preview=True) - c.argument('encryption_enforcement_policy', options_list=['--encryption-enforcement-policy', '--encryption-policy'], arg_type=get_enum_type(encryption_policy_types), help='To control if the Virtual Machine without encryption is allowed in encrypted Virtual Network or not.', min_api='2021-05-01', is_preview=True) - - with self.argument_context('network vnet peering') as c: - c.argument('virtual_network_name', virtual_network_name_type) - c.argument('virtual_network_peering_name', options_list=['--name', '-n'], help='The name of the VNet peering.', id_part='child_name_1') - c.argument('remote_virtual_network', options_list=['--remote-vnet'], help='Resource ID or name of the remote VNet.') - # endregion - - # region VirtualNetworkGateways - with self.argument_context('network vnet-gateway') as c: - c.argument('virtual_network_gateway_name', options_list=['--name', '-n'], help='Name of the VNet gateway.', completer=get_resource_name_completion_list('Microsoft.Network/virtualNetworkGateways'), id_part='name') - c.argument('gateway_name', help='Virtual network gateway name') - - with self.argument_context('network vnet-gateway vpn-client') as c: - c.argument('processor_architecture', help='Processor architecture of the target system.', arg_type=get_enum_type(['Amd64', 'X86'])) - c.argument('authentication_method', help='Method used to authenticate with the generated client.', arg_type=get_enum_type(['EAPMSCHAPv2', 'EAPTLS'])) - c.argument('radius_server_auth_certificate', help='Public certificate data for the Radius server auth certificate in Base-64 format. Required only if external Radius auth has been configured with EAPTLS auth.') - c.argument('client_root_certificates', nargs='+', help='Space-separated list of client root certificate public certificate data in Base-64 format. Optional for external Radius-based auth with EAPTLS') - c.argument('use_legacy', help='Generate VPN client package using legacy implementation.', arg_type=get_three_state_flag()) - # endregion - - # region VirtualNetworkGatewayConnections - with self.argument_context('network vpn-connection') as c: - c.argument('virtual_network_gateway_connection_name', options_list=['--name', '-n'], metavar='NAME', id_part='name', help='Connection name.') - c.argument('shared_key', help='Shared IPSec key.') - c.argument('connection_name', help='Connection name.') - c.argument('routing_weight', type=int, help='Connection routing weight') - c.argument('use_policy_based_traffic_selectors', min_api='2017-03-01', help='Enable policy-based traffic selectors.', arg_type=get_three_state_flag()) - c.argument('express_route_gateway_bypass', min_api='2018-07-01', arg_type=get_three_state_flag(), help='Bypass ExpressRoute gateway for data forwarding.') - c.argument('ingress_nat_rule', nargs='+', help='List of ingress NatRules.', min_api='2021-02-01', is_preview=True) - c.argument('egress_nat_rule', nargs='+', help='List of egress NatRules.', min_api='2021-02-01', is_preview=True) - - with self.argument_context('network vpn-connection list') as c: - c.argument('virtual_network_gateway_name', options_list=['--vnet-gateway'], help='Name of the VNet gateway.', completer=get_resource_name_completion_list('Microsoft.Network/virtualNetworkGateways')) - - with self.argument_context('network vpn-connection create') as c: - c.argument('connection_name', options_list=['--name', '-n'], metavar='NAME', help='Connection name.') - c.ignore('connection_type') - for item in ['vnet_gateway2', 'local_gateway2', 'express_route_circuit2']: - c.argument(item, arg_group='Destination') - # endregion - - # region PrivateLinkResource and PrivateEndpointConnection - from azure.cli.command_modules.network.azure_stack.private_link_resource_and_endpoint_connections.custom import TYPE_CLIENT_MAPPING, register_providers - register_providers() - for scope in ['private-link-resource', 'private-endpoint-connection']: - with self.argument_context('network {} list'.format(scope)) as c: - c.argument('name', required=False, help='Name of the resource. If provided, --type and --resource-group must be provided too', options_list=['--name', '-n']) - c.argument('resource_provider', required=False, help='Type of the resource. If provided, --name and --resource-group must be provided too', options_list='--type', arg_type=get_enum_type(TYPE_CLIENT_MAPPING.keys())) - c.argument('resource_group_name', required=False, help='Name of resource group. If provided, --name and --type must be provided too') - c.extra('id', help='ID of the resource', validator=process_private_link_resource_id_argument) - for scope in ['show', 'approve', 'reject', 'delete']: - with self.argument_context('network private-endpoint-connection {}'.format(scope)) as c: - c.extra('connection_id', options_list=['--id'], help='ID of the private endpoint connection', validator=process_private_endpoint_connection_id_argument) - c.argument('approval_description', options_list=['--description', '-d'], help='Comments for the approval.') - c.argument('rejection_description', options_list=['--description', '-d'], - help='Comments for the rejection.') - c.argument('name', required=False, help='Name of the private endpoint connection', - options_list=['--name', '-n']) - c.argument('resource_provider', required=False, help='Type of the resource.', options_list='--type', - arg_type=get_enum_type(TYPE_CLIENT_MAPPING.keys())) - c.argument('resource_group_name', required=False) - c.argument('resource_name', required=False, help='Name of the resource') - # endregion diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_template_builder.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/_template_builder.py deleted file mode 100644 index ee1fa8372d0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_template_builder.py +++ /dev/null @@ -1,508 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -def _build_frontend_ip_config(cmd, name, public_ip_id=None, subnet_id=None, private_ip_address=None, - private_ip_allocation=None, zone=None, private_ip_address_version=None, - enable_private_link=False, - private_link_configuration_id=None): - frontend_ip_config = { - 'name': name - } - - if public_ip_id: - frontend_ip_config.update({ - 'properties': { - 'publicIPAddress': {'id': public_ip_id} - } - }) - else: - frontend_ip_config.update({ - 'properties': { - 'privateIPAllocationMethod': private_ip_allocation, - 'privateIPAddress': private_ip_address, - 'subnet': {'id': subnet_id} - } - }) - - if zone and cmd.supported_api_version(min_api='2017-06-01'): - frontend_ip_config['zones'] = zone - - if private_ip_address_version and cmd.supported_api_version(min_api='2019-04-01'): - frontend_ip_config['properties']['privateIPAddressVersion'] = private_ip_address_version - - if enable_private_link is True and cmd.supported_api_version(min_api='2020-05-01'): - frontend_ip_config['properties'].update({ - 'privateLinkConfiguration': {'id': private_link_configuration_id} - }) - - return frontend_ip_config - - -def _build_appgw_private_link_ip_configuration(name, - private_link_ip_address, - private_link_ip_allocation_method, - private_link_primary, - private_link_subnet_id): - return { - 'name': name, - 'properties': { - 'privateIPAddress': private_link_ip_address, - 'privateIPAllocationMethod': private_link_ip_allocation_method, - 'primary': private_link_primary, - 'subnet': {'id': private_link_subnet_id} - } - } - - -# pylint: disable=too-many-locals, too-many-statements, too-many-branches -def build_application_gateway_resource(cmd, name, location, tags, sku_name, sku_tier, capacity, servers, frontend_port, - private_ip_address, private_ip_allocation, priority, - cert_data, cert_password, key_vault_secret_id, - cookie_based_affinity, http_settings_protocol, http_settings_port, - http_listener_protocol, routing_rule_type, public_ip_id, subnet_id, - connection_draining_timeout, enable_http2, min_capacity, zones, - custom_error_pages, firewall_policy, max_capacity, - user_assigned_identity, - enable_private_link=False, - private_link_name=None, - private_link_ip_address=None, - private_link_ip_allocation_method=None, - private_link_primary=None, - private_link_subnet_id=None, - trusted_client_certificates=None, - ssl_profile=None, - ssl_profile_id=None, - ssl_cert_name=None): - - # set the default names - frontend_public_ip_name = 'appGatewayFrontendIP' - frontend_private_ip_name = 'appGatewayPrivateFrontendIP' - backend_pool_name = 'appGatewayBackendPool' - frontend_port_name = 'appGatewayFrontendPort' - http_listener_name = 'appGatewayHttpListener' - http_settings_name = 'appGatewayBackendHttpSettings' - routing_rule_name = 'rule1' - - if not ssl_cert_name: - ssl_cert_name = '{}SslCert'.format(name) - - ssl_cert = None - - backend_address_pool = {'name': backend_pool_name} - if servers: - backend_address_pool['properties'] = {'BackendAddresses': servers} - - def _ag_subresource_id(_type, name): - return "[concat(variables('appGwID'), '/{}/{}')]".format(_type, name) - - frontend_port_id = _ag_subresource_id('frontendPorts', frontend_port_name) - http_listener_id = _ag_subresource_id('httpListeners', http_listener_name) - backend_address_pool_id = _ag_subresource_id('backendAddressPools', backend_pool_name) - backend_http_settings_id = _ag_subresource_id('backendHttpSettingsCollection', - http_settings_name) - ssl_cert_id = _ag_subresource_id('sslCertificates', ssl_cert_name) - - private_link_configuration_id = None - privateLinkConfigurations = [] - if cmd.supported_api_version(min_api='2020-05-01') and enable_private_link: - private_link_configuration_id = _ag_subresource_id('privateLinkConfigurations', - private_link_name) - - default_private_link_ip_config = _build_appgw_private_link_ip_configuration( - 'PrivateLinkDefaultIPConfiguration', - private_link_ip_address, - private_link_ip_allocation_method, - private_link_primary, - private_link_subnet_id - ) - privateLinkConfigurations.append({ - 'name': private_link_name, - 'properties': { - 'ipConfigurations': [default_private_link_ip_config] - } - }) - - frontend_ip_configs = [] - - # 4 combinations are valid for creating application gateway regarding to private IP and public IP - # --------------------------------------------------------------------------------------------| - # | | private_ip_address | private_ip_address | - # | | it not None | is None | - # --------------------------------------------------------------------------------------------| - # | | private_ip_allocation: "Static" | private_ip_allocation: "Dynamic" | - # | | frontend_private_ip built: yes | frontend_private_ip built: no | - # | public_ip_address | | | - # | it not None | frontend_public_ip built: yes | frontend_public_ip built: no | - # | | | | - # | | 2 frontend IP configs entries | 1 frontend IP configs entry | - # | | | | - # | | frontend_ip_config_id: public_ip | frontend_ip_config_id:public_ip | - # | | | | - # | | private link link to public IP | private link link to public IP | - # |-------------------------------------------------------------------------------------------| - # | | private_ip_allocation: "Static" | private_ip_allocation: "Dynamic" | - # | public_ip_address | frontend_private_ip built: yes | frontend_private_ip built: no | - # | is None | | | - # | | frontend_public_ip built: no | frontend_public_ip built: no | - # | | | | - # | | 1 frontend IP configs entry | 1 frontend IP configs entry | - # | | | | - # | | frontend_ip_config_id: priavte_ip | frontend_ip_config_id: priavte_ip | - # | | | | - # | | private link link to private IP | private link link to private IP | - # |-------------------------------------------------------------------------------------------| - if private_ip_address is not None or public_ip_id is None: - enable_private_link = False if public_ip_id else enable_private_link - frontend_private_ip = _build_frontend_ip_config(cmd, frontend_private_ip_name, - subnet_id=subnet_id, - private_ip_address=private_ip_address, - private_ip_allocation=private_ip_allocation, - enable_private_link=enable_private_link, - private_link_configuration_id=private_link_configuration_id) - frontend_ip_configs.append(frontend_private_ip) - - frontend_ip_config_id = _ag_subresource_id('frontendIPConfigurations', frontend_private_ip_name) - if public_ip_id: - frontend_public_ip = _build_frontend_ip_config(cmd, frontend_public_ip_name, - public_ip_id=public_ip_id, - enable_private_link=enable_private_link, - private_link_configuration_id=private_link_configuration_id) - frontend_ip_configs.append(frontend_public_ip) - - frontend_ip_config_id = _ag_subresource_id('frontendIPConfigurations', frontend_public_ip_name) - - http_listener = { - 'name': http_listener_name, - 'properties': { - 'FrontendIpConfiguration': {'Id': frontend_ip_config_id}, - 'FrontendPort': {'Id': frontend_port_id}, - 'Protocol': http_listener_protocol, - 'SslCertificate': None - } - } - if cert_data: - http_listener['properties'].update({'SslCertificate': {'id': ssl_cert_id}}) - ssl_cert = { - 'name': ssl_cert_name, - 'properties': { - 'data': cert_data, - } - } - if cert_password: - ssl_cert['properties']['password'] = "[parameters('certPassword')]" - - if key_vault_secret_id: - http_listener['properties'].update({'SslCertificate': {'id': ssl_cert_id}}) - ssl_cert = { - 'name': ssl_cert_name, - 'properties': { - 'keyVaultSecretId': key_vault_secret_id, - } - } - if ssl_profile_id and cmd.supported_api_version(min_api='2020-06-01'): - http_listener['properties'].update({'sslProfile': {'id': ssl_profile_id}}) - - backend_http_settings = { - 'name': http_settings_name, - 'properties': { - 'Port': http_settings_port, - 'Protocol': http_settings_protocol, - 'CookieBasedAffinity': cookie_based_affinity - } - } - if cmd.supported_api_version(min_api='2016-12-01'): - backend_http_settings['properties']['connectionDraining'] = { - 'enabled': bool(connection_draining_timeout), - 'drainTimeoutInSec': connection_draining_timeout if connection_draining_timeout else 1 - } - - ag_properties = { - 'backendAddressPools': [backend_address_pool], - 'backendHttpSettingsCollection': [backend_http_settings], - 'frontendIPConfigurations': frontend_ip_configs, - 'frontendPorts': [ - { - 'name': frontend_port_name, - 'properties': { - 'Port': frontend_port - } - } - ], - 'gatewayIPConfigurations': [ - { - 'name': frontend_public_ip_name if public_ip_id else frontend_private_ip_name, - 'properties': { - 'subnet': {'id': subnet_id} - } - } - ], - 'httpListeners': [http_listener], - 'sku': { - 'name': sku_name, - 'tier': sku_tier, - 'capacity': capacity - }, - 'requestRoutingRules': [ - { - 'Name': routing_rule_name, - 'properties': { - 'RuleType': routing_rule_type, - 'httpListener': {'id': http_listener_id}, - 'backendAddressPool': {'id': backend_address_pool_id}, - 'backendHttpSettings': {'id': backend_http_settings_id} - } - } - ], - 'privateLinkConfigurations': privateLinkConfigurations, - } - if sku_name.lower() == 'standard_v2' or sku_name.lower() == 'waf_v2': - if cmd.supported_api_version(min_api='2021-08-01') and priority: - ag_properties['requestRoutingRules'][0]['properties'].update({'priority': priority}) - if ssl_cert: - ag_properties.update({'sslCertificates': [ssl_cert]}) - if enable_http2 and cmd.supported_api_version(min_api='2017-10-01'): - ag_properties.update({'enableHttp2': enable_http2}) - if min_capacity and cmd.supported_api_version(min_api='2018-07-01'): - if 'autoscaleConfiguration' not in ag_properties: - ag_properties['autoscaleConfiguration'] = {} - ag_properties['autoscaleConfiguration'].update({'minCapacity': min_capacity}) - ag_properties['sku'].pop('capacity', None) - if max_capacity and cmd.supported_api_version(min_api='2018-12-01'): - if 'autoscaleConfiguration' not in ag_properties: - ag_properties['autoscaleConfiguration'] = {} - ag_properties['autoscaleConfiguration'].update({'maxCapacity': max_capacity}) - ag_properties['sku'].pop('capacity', None) - if custom_error_pages and cmd.supported_api_version(min_api='2018-08-01'): - ag_properties.update({'customErrorConfigurations': custom_error_pages}) - if firewall_policy and cmd.supported_api_version(min_api='2018-12-01'): - ag_properties.update({'firewallPolicy': {'id': firewall_policy}}) - - # mutual authentication support - if cmd.supported_api_version(min_api='2020-06-01') and trusted_client_certificates: - parameters = [] - for item in trusted_client_certificates: - parameters.append( - { - "name": item['name'], - "properties": { - "data": item['data'] - } - } - ) - ag_properties.update({"trustedClientCertificates": parameters}) - - # ssl profiles - if cmd.supported_api_version(min_api='2020-06-01') and ssl_profile: - parameters = [] - for item in ssl_profile: - parameter = { - "name": item['name'], - "properties": { - "sslPolicy": {} - } - } - if 'policy_name' in item: - parameter['properties']['sslPolicy'].update({"policyName": item['policy_name']}) - if 'policy_type' in item: - parameter['properties']['sslPolicy'].update({"policyType": item['policy_type']}) - if 'min_protocol_version' in item: - parameter['properties']['sslPolicy'].update({"minProtocolVersion": item['min_protocol_version']}) - if 'cipher_suites' in item: - parameter['properties']['sslPolicy'].update({"cipherSuites": item['cipher_suites']}) - if 'client_auth_configuration' in item: - parameter['properties'].update( - {"clientAuthConfiguration": {"verifyClientCertIssuerDN": item['client_auth_configuration']}}) - if 'trusted_client_certificates' in item: - parameter['properties'].update( - {"trustedClientCertificates": [{"id": id['trusted_client_certificates']} for id in item]}) - - parameters.append(parameter) - - ag_properties.update({"sslProfiles": parameters}) - - ag = { - 'type': 'Microsoft.Network/applicationGateways', - 'name': name, - 'location': location, - 'tags': tags, - 'apiVersion': cmd.get_api_version(), - 'dependsOn': [], - 'properties': ag_properties - } - if cmd.supported_api_version(min_api='2018-08-01'): - ag.update({'zones': zones}) - if user_assigned_identity and cmd.supported_api_version(min_api='2018-12-01'): - ag.update( - { - "identity": { - "type": "UserAssigned", - "userAssignedIdentities": { - user_assigned_identity: {} - } - } - } - ) - - return ag - - -def build_load_balancer_resource(cmd, name, location, tags, backend_pool_name, frontend_ip_name, public_ip_id, - subnet_id, private_ip_address, private_ip_allocation, - sku, frontend_ip_zone, private_ip_address_version, tier=None, - edge_zone=None, edge_zone_type=None): - frontend_ip_config = _build_frontend_ip_config(cmd, frontend_ip_name, public_ip_id, subnet_id, private_ip_address, - private_ip_allocation, frontend_ip_zone, private_ip_address_version) - - lb_properties = { - 'backendAddressPools': [ - { - 'name': backend_pool_name - } - ], - 'frontendIPConfigurations': [frontend_ip_config] - } - - # when sku is 'gateway', 'tunnelInterfaces' can't be None. Otherwise service will response error - if cmd.supported_api_version(min_api='2021-02-01') and sku and str(sku).lower() == 'gateway': - lb_properties['backendAddressPools'][0]['properties'] = { - 'tunnelInterfaces': [{'protocol': 'VXLAN', - 'type': 'Internal', - "identifier": 900}]} - - lb = { - 'type': 'Microsoft.Network/loadBalancers', - 'name': name, - 'location': location, - 'tags': tags, - 'apiVersion': cmd.get_api_version(), - 'dependsOn': [], - 'properties': lb_properties - } - if sku and cmd.supported_api_version(min_api='2017-08-01'): - lb['sku'] = {'name': sku} - if tier and cmd.supported_api_version(min_api='2020-07-01'): - lb['sku'].update({'tier': tier}) - if edge_zone and edge_zone_type: - lb['extendedLocation'] = {'name': edge_zone, 'type': edge_zone_type} - return lb - - -def build_public_ip_resource(cmd, name, location, tags, address_allocation, dns_name, sku, zone, tier=None, - edge_zone=None, edge_zone_type=None): - public_ip_properties = {'publicIPAllocationMethod': address_allocation} - - if dns_name: - public_ip_properties['dnsSettings'] = {'domainNameLabel': dns_name} - - public_ip = { - 'apiVersion': cmd.get_api_version(), - 'type': 'Microsoft.Network/publicIPAddresses', - 'name': name, - 'location': location, - 'tags': tags, - 'dependsOn': [], - 'properties': public_ip_properties - } - if sku and cmd.supported_api_version(min_api='2017-08-01'): - public_ip['sku'] = {'name': sku} - if tier and cmd.supported_api_version(min_api='2020-07-01'): - if not sku: - public_ip['sku'] = {'name': 'Basic'} - public_ip['sku'].update({'tier': tier}) - if zone and cmd.supported_api_version(min_api='2017-06-01'): - public_ip['zones'] = zone - if edge_zone and edge_zone_type: - public_ip['extendedLocation'] = {'name': edge_zone, 'type': edge_zone_type} - return public_ip - - -def build_vnet_resource(_, name, location, tags, vnet_prefix=None, subnet=None, subnet_prefix=None, dns_servers=None, - enable_private_link=False, private_link_subnet=None, private_link_subnet_prefix=None): - vnet = { - 'name': name, - 'type': 'Microsoft.Network/virtualNetworks', - 'location': location, - 'apiVersion': '2015-06-15', - 'dependsOn': [], - 'tags': tags, - 'properties': { - 'addressSpace': {'addressPrefixes': [vnet_prefix]}, - 'subnets': [] - } - } - if dns_servers: - vnet['properties']['dhcpOptions'] = { - 'dnsServers': dns_servers - } - if subnet: - vnet['properties']['subnets'].append({ - 'name': subnet, - 'properties': { - 'addressPrefix': subnet_prefix - } - }) - if enable_private_link: - vnet['properties']['subnets'].append({ - 'name': private_link_subnet, - 'properties': { - 'addressPrefix': private_link_subnet_prefix, - 'privateLinkServiceNetworkPolicies': 'Disabled', - } - }) - - return vnet - - -def build_vpn_connection_resource(cmd, name, location, tags, gateway1, gateway2, vpn_type, authorization_key, - enable_bgp, routing_weight, shared_key, use_policy_based_traffic_selectors, - express_route_gateway_bypass, ingress_nat_rule, egress_nat_rule): - vpn_properties = { - 'virtualNetworkGateway1': {'id': gateway1}, - 'enableBgp': enable_bgp, - 'connectionType': vpn_type, - 'routingWeight': routing_weight - } - if authorization_key: - vpn_properties['authorizationKey'] = "[parameters('authorizationKey')]" - if cmd.supported_api_version(min_api='2017-03-01'): - vpn_properties['usePolicyBasedTrafficSelectors'] = use_policy_based_traffic_selectors - if cmd.supported_api_version(min_api='2018-07-01'): - vpn_properties['expressRouteGatewayBypass'] = express_route_gateway_bypass - - # add scenario specific properties - if shared_key: - shared_key = "[parameters('sharedKey')]" - if vpn_type == 'IPSec': - vpn_properties.update({ - 'localNetworkGateway2': {'id': gateway2}, - 'sharedKey': shared_key - }) - elif vpn_type == 'Vnet2Vnet': - vpn_properties.update({ - 'virtualNetworkGateway2': {'id': gateway2}, - 'sharedKey': shared_key - }) - elif vpn_type == 'ExpressRoute': - vpn_properties.update({ - 'peer': {'id': gateway2} - }) - - if ingress_nat_rule: - vpn_properties['ingressNatRules'] = [{'id': rule} for rule in ingress_nat_rule] - - if egress_nat_rule: - vpn_properties['egressNatRules'] = [{'id': rule} for rule in egress_nat_rule] - - vpn_connection = { - 'type': 'Microsoft.Network/connections', - 'name': name, - 'location': location, - 'tags': tags, - 'apiVersion': '2015-06-15', - 'dependsOn': [], - 'properties': vpn_properties if vpn_type != 'VpnClient' else {} - } - return vpn_connection diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_util.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/_util.py deleted file mode 100644 index 4a14a5bd554..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_util.py +++ /dev/null @@ -1,17 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -from azure.cli.core.azclierror import UnrecognizedArgumentError - - -def _list_to_dict(enum_list): - return {item.lower(): item for item in enum_list} - - -def enum_check(value, enum_list): - try: - return _list_to_dict(enum_list)[value.lower()] - except: - raise UnrecognizedArgumentError(f'{value} is not recognized, it must be one of {enum_list}') diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_validators.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/_validators.py deleted file mode 100644 index 71699b7b24e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/_validators.py +++ /dev/null @@ -1,395 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -# pylint: disable=too-many-lines - -from knack.util import CLIError -from knack.log import get_logger - -from azure.cli.core.commands.validators import \ - (validate_tags, get_default_location_from_resource_group) -from azure.cli.core.commands.template_create import get_folded_parameter_validator -from azure.cli.core.commands.client_factory import get_subscription_id - -logger = get_logger(__name__) - - -def get_vnet_validator(dest): - from azure.mgmt.core.tools import is_valid_resource_id, resource_id - - def _validate_vnet_name_or_id(cmd, namespace): - SubResource = cmd.get_models('SubResource') - subscription_id = get_subscription_id(cmd.cli_ctx) - - resource_group = namespace.resource_group_name - names_or_ids = getattr(namespace, dest) - ids = [] - - if names_or_ids == [''] or not names_or_ids: - return - - for val in names_or_ids: - if not is_valid_resource_id(val): - val = resource_id( - subscription=subscription_id, - resource_group=resource_group, - namespace='Microsoft.Network', type='virtualNetworks', - name=val - ) - ids.append(SubResource(id=val)) - setattr(namespace, dest, ids) - - return _validate_vnet_name_or_id - - -def validate_ddos_name_or_id(cmd, namespace): - if namespace.ddos_protection_plan: - from azure.mgmt.core.tools import is_valid_resource_id, resource_id - if not is_valid_resource_id(namespace.ddos_protection_plan): - namespace.ddos_protection_plan = resource_id( - subscription=get_subscription_id(cmd.cli_ctx), - resource_group=namespace.resource_group_name, - namespace='Microsoft.Network', type='ddosProtectionPlans', - name=namespace.ddos_protection_plan - ) - - -# pylint: disable=inconsistent-return-statements -def dns_zone_name_type(value): - if value: - return value[:-1] if value[-1] == '.' else value - - -def _generate_ag_subproperty_id(cli_ctx, namespace, child_type, child_name, subscription=None): - from azure.mgmt.core.tools import resource_id - return resource_id( - subscription=subscription or get_subscription_id(cli_ctx), - resource_group=namespace.resource_group_name, - namespace='Microsoft.Network', - type='applicationGateways', - name=namespace.application_gateway_name, - child_type_1=child_type, - child_name_1=child_name) - - -def _generate_lb_subproperty_id(cli_ctx, namespace, child_type, child_name, subscription=None): - from azure.mgmt.core.tools import resource_id - return resource_id( - subscription=subscription or get_subscription_id(cli_ctx), - resource_group=namespace.resource_group_name, - namespace='Microsoft.Network', - type='loadBalancers', - name=namespace.load_balancer_name, - child_type_1=child_type, - child_name_1=child_name) - - -def validate_address_pool_name_or_id(cmd, namespace): - from azure.mgmt.core.tools import is_valid_resource_id, parse_resource_id - address_pool = namespace.backend_address_pool - lb_name = namespace.load_balancer_name - gateway_name = getattr(namespace, 'application_gateway_name', None) - - usage_error = CLIError('usage error: --address-pool ID | --lb-name NAME --address-pool NAME ' - '| --gateway-name NAME --address-pool NAME') - - if is_valid_resource_id(address_pool): - if lb_name or gateway_name: - raise usage_error - parts = parse_resource_id(address_pool) - if parts['type'] == 'loadBalancers': - namespace.load_balancer_name = parts['name'] - elif parts['type'] == 'applicationGateways': - namespace.application_gateway_name = parts['name'] - else: - raise usage_error - else: - if bool(lb_name) == bool(gateway_name): - raise usage_error - - if lb_name: - namespace.backend_address_pool = _generate_lb_subproperty_id( - cmd.cli_ctx, namespace, 'backendAddressPools', address_pool) - elif gateway_name: - namespace.backend_address_pool = _generate_ag_subproperty_id( - cmd.cli_ctx, namespace, 'backendAddressPools', address_pool) - - -def validate_dns_record_type(namespace): - tokens = namespace.command.split(' ') - types = ['a', 'aaaa', 'caa', 'cname', 'mx', 'ns', 'ptr', 'soa', 'srv', 'txt'] - for token in tokens: - if token in types: - if hasattr(namespace, 'record_type'): - namespace.record_type = token - else: - namespace.record_set_type = token - return - - -def validate_ip_tags(namespace): - ''' Extracts multiple space-separated tags in TYPE=VALUE format ''' - if namespace.ip_tags: - ip_tags = [] - for item in namespace.ip_tags: - tag_type, tag_value = item.split('=', 1) - ip_tags.append({"ip_tag_type": tag_type, "tag": tag_value}) - namespace.ip_tags = ip_tags - - -def validate_metadata(namespace): - if namespace.metadata: - namespace.metadata = dict(x.split('=', 1) for x in namespace.metadata) - - -def validate_public_ip_prefix(cmd, namespace): - from azure.mgmt.core.tools import is_valid_resource_id, resource_id - if namespace.public_ip_prefix and not is_valid_resource_id(namespace.public_ip_prefix): - namespace.public_ip_prefix = resource_id( - subscription=get_subscription_id(cmd.cli_ctx), - resource_group=namespace.resource_group_name, - name=namespace.public_ip_prefix, - namespace='Microsoft.Network', - type='publicIPPrefixes') - - -def validate_private_ip_address(namespace): - if namespace.private_ip_address and hasattr(namespace, 'private_ip_address_allocation'): - namespace.private_ip_address_allocation = 'static' - - -def get_public_ip_validator(has_type_field=False, allow_none=False, allow_new=False, - default_none=False): - """ Retrieves a validator for public IP address. Accepting all defaults will perform a check - for an existing name or ID with no ARM-required -type parameter. """ - from azure.mgmt.core.tools import is_valid_resource_id, resource_id - - def simple_validator(cmd, namespace): - if namespace.public_ip_address: - is_list = isinstance(namespace.public_ip_address, list) - - def _validate_name_or_id(public_ip): - # determine if public_ip_address is name or ID - is_id = is_valid_resource_id(public_ip) - return public_ip if is_id else resource_id( - subscription=get_subscription_id(cmd.cli_ctx), - resource_group=namespace.resource_group_name, - namespace='Microsoft.Network', - type='publicIPAddresses', - name=public_ip) - - if is_list: - for i, public_ip in enumerate(namespace.public_ip_address): - namespace.public_ip_address[i] = _validate_name_or_id(public_ip) - else: - namespace.public_ip_address = _validate_name_or_id(namespace.public_ip_address) - - def complex_validator_with_type(cmd, namespace): - get_folded_parameter_validator( - 'public_ip_address', 'Microsoft.Network/publicIPAddresses', '--public-ip-address', - allow_none=allow_none, allow_new=allow_new, default_none=default_none)(cmd, namespace) - - return complex_validator_with_type if has_type_field else simple_validator - - -def get_subnet_validator(has_type_field=False, allow_none=False, allow_new=False, - default_none=False): - from azure.mgmt.core.tools import is_valid_resource_id, resource_id - - def simple_validator(cmd, namespace): - if namespace.virtual_network_name is None and namespace.subnet is None: - return - if namespace.subnet == '': - return - usage_error = ValueError('incorrect usage: ( --subnet ID | --subnet NAME --vnet-name NAME)') - # error if vnet-name is provided without subnet - if namespace.virtual_network_name and not namespace.subnet: - raise usage_error - - # determine if subnet is name or ID - is_id = is_valid_resource_id(namespace.subnet) - - # error if vnet-name is provided along with a subnet ID - if is_id and namespace.virtual_network_name: - raise usage_error - if not is_id and not namespace.virtual_network_name: - raise usage_error - - if not is_id: - namespace.subnet = resource_id( - subscription=get_subscription_id(cmd.cli_ctx), - resource_group=namespace.resource_group_name, - namespace='Microsoft.Network', - type='virtualNetworks', - name=namespace.virtual_network_name, - child_type_1='subnets', - child_name_1=namespace.subnet) - - def complex_validator_with_type(cmd, namespace): - - get_folded_parameter_validator( - 'subnet', 'subnets', '--subnet', - 'virtual_network_name', 'Microsoft.Network/virtualNetworks', '--vnet-name', - allow_none=allow_none, allow_new=allow_new, default_none=default_none)(cmd, namespace) - - return complex_validator_with_type if has_type_field else simple_validator - - -def validate_subresource_list(cmd, namespace): - if namespace.target_resources: - SubResource = cmd.get_models('SubResource') - subresources = [] - for item in namespace.target_resources: - subresources.append(SubResource(id=item)) - namespace.target_resources = subresources - - -# COMMAND NAMESPACE VALIDATORS - - -def process_lb_create_namespace(cmd, namespace): - get_default_location_from_resource_group(cmd, namespace) - validate_tags(namespace) - - if namespace.subnet and namespace.public_ip_address: - raise ValueError( - 'incorrect usage: --subnet NAME --vnet-name NAME | ' - '--subnet ID | --public-ip-address NAME_OR_ID') - - if namespace.subnet: - # validation for an internal load balancer - get_subnet_validator( - has_type_field=True, allow_new=True, allow_none=True, default_none=True)(cmd, namespace) - - namespace.public_ip_address_type = None - namespace.public_ip_address = None - - else: - # validation for internet facing load balancer - get_public_ip_validator(has_type_field=True, allow_none=True, allow_new=True)(cmd, namespace) - - if namespace.public_ip_dns_name and namespace.public_ip_address_type != 'new': - raise CLIError( - 'specify --public-ip-dns-name only if creating a new public IP address.') - - namespace.subnet_type = None - namespace.subnet = None - namespace.virtual_network_name = None - - -def process_public_ip_create_namespace(cmd, namespace): - get_default_location_from_resource_group(cmd, namespace) - if 'public_ip_prefix' in namespace: - validate_public_ip_prefix(cmd, namespace) - if 'ip_tags' in namespace: - validate_ip_tags(namespace) - validate_tags(namespace) - if 'sku' in namespace or 'zone' in namespace: - _inform_coming_breaking_change_for_public_ip(namespace) - - -def _inform_coming_breaking_change_for_public_ip(namespace): - if namespace.sku == 'Standard' and not namespace.zone: - logger.warning('[Coming breaking change] In the coming release, the default behavior will be changed as follows' - ' when sku is Standard and zone is not provided:' - ' For zonal regions, you will get a zone-redundant IP indicated by zones:["1","2","3"];' - ' For non-zonal regions, you will get a non zone-redundant IP indicated by zones:null.') - - -def process_vpn_connection_create_namespace(cmd, namespace): - from azure.mgmt.core.tools import is_valid_resource_id, resource_id - get_default_location_from_resource_group(cmd, namespace) - validate_tags(namespace) - - args = [a for a in [namespace.express_route_circuit2, - namespace.local_gateway2, - namespace.vnet_gateway2] - if a] - if len(args) != 1: - raise ValueError('usage error: --vnet-gateway2 NAME_OR_ID | --local-gateway2 NAME_OR_ID ' - '| --express-route-circuit2 NAME_OR_ID') - - def _validate_name_or_id(value, resource_type): - if not is_valid_resource_id(value): - subscription = getattr(namespace, 'subscription', get_subscription_id(cmd.cli_ctx)) - return resource_id( - subscription=subscription, - resource_group=namespace.resource_group_name, - namespace='Microsoft.Network', - type=resource_type, - name=value) - return value - - if (namespace.local_gateway2 or namespace.vnet_gateway2) and not namespace.shared_key: - raise CLIError('--shared-key is required for VNET-to-VNET or Site-to-Site connections.') - - if namespace.express_route_circuit2 and namespace.shared_key: - raise CLIError('--shared-key cannot be used with an ExpressRoute connection.') - - namespace.vnet_gateway1 = \ - _validate_name_or_id(namespace.vnet_gateway1, 'virtualNetworkGateways') - - if namespace.express_route_circuit2: - namespace.express_route_circuit2 = \ - _validate_name_or_id( - namespace.express_route_circuit2, 'expressRouteCircuits') - namespace.connection_type = 'ExpressRoute' - elif namespace.local_gateway2: - namespace.local_gateway2 = \ - _validate_name_or_id(namespace.local_gateway2, 'localNetworkGateways') - namespace.connection_type = 'IPSec' - elif namespace.vnet_gateway2: - namespace.vnet_gateway2 = \ - _validate_name_or_id(namespace.vnet_gateway2, 'virtualNetworkGateways') - namespace.connection_type = 'Vnet2Vnet' - - -def process_private_link_resource_id_argument(cmd, namespace): - if all([namespace.resource_group_name, - namespace.name, - namespace.resource_provider]): - logger.warning("Resource ID will be ignored since other three arguments have been provided.") - del namespace.id - return - - if not (namespace.id or all([namespace.resource_group_name, - namespace.name, - namespace.resource_provider])): - raise CLIError("usage error: --id / -g -n --type") - - from azure.mgmt.core.tools import is_valid_resource_id, parse_resource_id - if not is_valid_resource_id(namespace.id): - raise CLIError("Resource ID is invalid. Please check it.") - split_resource_id = parse_resource_id(namespace.id) - cmd.cli_ctx.data['subscription_id'] = split_resource_id['subscription'] - namespace.resource_group_name = split_resource_id['resource_group'] - namespace.name = split_resource_id['name'] - namespace.resource_provider = '{}/{}'.format(split_resource_id['namespace'], split_resource_id['type']) - del namespace.id - - -def process_private_endpoint_connection_id_argument(cmd, namespace): - from azure.cli.core.util import parse_proxy_resource_id - if all([namespace.resource_group_name, - namespace.name, - namespace.resource_provider, - namespace.resource_name]): - logger.warning("Resource ID will be ignored since other three arguments have been provided.") - del namespace.connection_id - return - - if not (namespace.connection_id or all([namespace.resource_group_name, - namespace.name, - namespace.resource_provider, - namespace.resource_name])): - raise CLIError("usage error: --id / -g -n --type --resource-name") - - result = parse_proxy_resource_id(namespace.connection_id) - cmd.cli_ctx.data['subscription_id'] = result['subscription'] - namespace.resource_group_name = result['resource_group'] - namespace.resource_name = result['name'] - namespace.resource_provider = '{}/{}'.format(result['namespace'], result['type']) - namespace.name = result['child_name_1'] - del namespace.connection_id diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/commands.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/commands.py deleted file mode 100644 index bc042e783a2..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/commands.py +++ /dev/null @@ -1,120 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# 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,too-many-lines - -from azure.cli.core.commands import DeploymentOutputLongRunningOperation -from azure.cli.core.commands.arm import ( - deployment_validate_table_format, handle_template_based_exception) -from azure.cli.core.commands import CliCommandType -from azure.cli.core.profiles import get_api_version, ResourceType - -from azure.cli.command_modules.network.azure_stack._client_factory import ( - cf_dns_mgmt_record_sets, cf_dns_mgmt_zones, - cf_dns_references) -from azure.cli.command_modules.network.azure_stack._format import ( - transform_dns_record_set_output, - transform_dns_record_set_table_output, transform_dns_zone_table_output) -from azure.cli.command_modules.network.azure_stack._validators import ( - process_lb_create_namespace, - process_vpn_connection_create_namespace) - - -# pylint: disable=too-many-locals, too-many-statements -def load_command_table(self, _): - - # region Command Types - - network_dns_zone_sdk = CliCommandType( - operations_tmpl='azure.mgmt.dns.operations#ZonesOperations.{}', - client_factory=cf_dns_mgmt_zones, - resource_type=ResourceType.MGMT_NETWORK_DNS - ) - - network_dns_record_set_sdk = CliCommandType( - operations_tmpl='azure.mgmt.dns.operations#RecordSetsOperations.{}', - client_factory=cf_dns_mgmt_record_sets, - resource_type=ResourceType.MGMT_NETWORK_DNS - ) - - network_dns_reference_sdk = CliCommandType( - operations_tmpl='azure.mgmt.dns.operations#DnsResourceReferenceOperations.{}', - client_factory=cf_dns_references, - resource_type=ResourceType.MGMT_NETWORK_DNS, - min_api='2018-05-01' - ) - - # region DNS - with self.command_group('network dns', network_dns_reference_sdk, resource_type=ResourceType.MGMT_NETWORK_DNS) as g: - g.command('list-references', 'get_by_target_resources') - - with self.command_group('network dns zone', network_dns_zone_sdk) as g: - g.command('delete', 'begin_delete', confirmation=True) - g.show_command('show', 'get', table_transformer=transform_dns_zone_table_output) - g.custom_command('list', 'list_dns_zones', table_transformer=transform_dns_zone_table_output) - g.custom_command('import', 'import_zone') - g.custom_command('export', 'export_zone') - g.custom_command('create', 'create_dns_zone', client_factory=cf_dns_mgmt_zones) - g.generic_update_command('update', custom_func_name='update_dns_zone') - - with self.command_group('network dns record-set') as g: - g.custom_command('list', 'list_dns_record_set', client_factory=cf_dns_mgmt_record_sets, transform=transform_dns_record_set_output) - - api_version = str(get_api_version(self.cli_ctx, ResourceType.MGMT_NETWORK_DNS)) - api_version = api_version.replace('-', '_') - dns_doc_string = 'azure.mgmt.dns.v' + api_version + '.operations#RecordSetsOperations.create_or_update' - - supported_records = ['a', 'aaaa', 'mx', 'ns', 'ptr', 'srv', 'txt'] - if self.supported_api_version(resource_type=ResourceType.MGMT_NETWORK_DNS, min_api='2018-02-01'): - supported_records.append('caa') - for record in supported_records: - with self.command_group('network dns record-set {}'.format(record), network_dns_record_set_sdk, resource_type=ResourceType.MGMT_NETWORK_DNS) as g: - g.show_command('show', 'get', transform=transform_dns_record_set_output) - g.command('delete', 'delete', confirmation=True) - g.custom_command('list', 'list_dns_record_set', client_factory=cf_dns_mgmt_record_sets, transform=transform_dns_record_set_output, table_transformer=transform_dns_record_set_table_output) - g.custom_command('create', 'create_dns_record_set', transform=transform_dns_record_set_output, doc_string_source=dns_doc_string) - g.custom_command('add-record', 'add_dns_{}_record'.format(record), transform=transform_dns_record_set_output) - g.custom_command('remove-record', 'remove_dns_{}_record'.format(record), transform=transform_dns_record_set_output) - g.generic_update_command('update', custom_func_name='update_dns_record_set', transform=transform_dns_record_set_output) - - with self.command_group('network dns record-set soa', network_dns_record_set_sdk) as g: - g.show_command('show', 'get', transform=transform_dns_record_set_output) - g.custom_command('update', 'update_dns_soa_record', transform=transform_dns_record_set_output) - - with self.command_group('network dns record-set cname', network_dns_record_set_sdk) as g: - g.show_command('show', 'get', transform=transform_dns_record_set_output) - g.command('delete', 'delete', confirmation=True) - g.custom_command('list', 'list_dns_record_set', client_factory=cf_dns_mgmt_record_sets, transform=transform_dns_record_set_output, table_transformer=transform_dns_record_set_table_output) - g.custom_command('create', 'create_dns_record_set', transform=transform_dns_record_set_output, doc_string_source=dns_doc_string) - g.custom_command('set-record', 'add_dns_cname_record', transform=transform_dns_record_set_output) - g.custom_command('remove-record', 'remove_dns_cname_record', transform=transform_dns_record_set_output) - # endregion - - # region LoadBalancers - with self.command_group('network lb') as g: - g.custom_command('create', 'create_load_balancer', - transform=DeploymentOutputLongRunningOperation(self.cli_ctx), - supports_no_wait=True, - table_transformer=deployment_validate_table_format, - validator=process_lb_create_namespace, - exception_handler=handle_template_based_exception) - # endregion - - # region VirtualNetworkGatewayConnections - with self.command_group('network vpn-connection') as g: - g.custom_command('create', 'create_vpn_connection', transform=DeploymentOutputLongRunningOperation(self.cli_ctx), table_transformer=deployment_validate_table_format, validator=process_vpn_connection_create_namespace, exception_handler=handle_template_based_exception) - # endregion - - # region PrivateLinkResource and PrivateEndpointConnection - plr_and_pec_custom = CliCommandType(operations_tmpl='azure.cli.command_modules.network.azure_stack.private_link_resource_and_endpoint_connections.custom#{}') - with self.command_group('network private-link-resource', custom_command_type=plr_and_pec_custom) as g: - g.custom_show_command('list', 'list_private_link_resource') - with self.command_group('network private-endpoint-connection', custom_command_type=plr_and_pec_custom) as g: - g.custom_command('approve', 'approve_private_endpoint_connection') - g.custom_command('reject', 'reject_private_endpoint_connection') - g.custom_command('delete', 'remove_private_endpoint_connection', confirmation=True) - g.custom_show_command('show', 'show_private_endpoint_connection') - g.custom_command('list', 'list_private_endpoint_connection') - # endregion diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/custom.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/custom.py deleted file mode 100644 index 34fecefaf39..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/custom.py +++ /dev/null @@ -1,949 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -from collections import Counter, OrderedDict -from knack.log import get_logger -from azure.mgmt.core.tools import parse_resource_id, is_valid_resource_id, resource_id -# pylint: disable=no-self-use,no-member,too-many-lines,unused-argument, line-too-long -from azure.cli.core.commands.client_factory import get_subscription_id, get_mgmt_service_client - -from azure.cli.core.util import CLIError, sdk_no_wait -from azure.cli.core.profiles import ResourceType, supported_api_version - -from azure.cli.command_modules.network.azure_stack.zone_file.parse_zone_file import parse_zone_file -from azure.cli.command_modules.network.azure_stack.zone_file.make_zone_file import make_zone_file - -logger = get_logger(__name__) - - -# region Utility methods -def _log_pprint_template(template): - import json - logger.info('==== BEGIN TEMPLATE ====') - logger.info(json.dumps(template, indent=2)) - logger.info('==== END TEMPLATE ====') -# endregion - - -# region ApplicationGateways -# pylint: disable=too-many-locals -def _is_v2_sku(sku): - return 'v2' in sku - - -# pylint: disable=too-many-statements -# region DNS Commands -# add delegation name server record for the created child zone in it's parent zone. -def add_dns_delegation(cmd, child_zone, parent_zone, child_rg, child_zone_name): - """ - :param child_zone: the zone object corresponding to the child that is created. - :param parent_zone: the parent zone name / FQDN of the parent zone. - if parent zone name is mentioned, assume current subscription and resource group. - :param child_rg: resource group of the child zone - :param child_zone_name: name of the child zone - """ - import sys - from azure.core.exceptions import HttpResponseError - parent_rg = child_rg - parent_subscription_id = None - parent_zone_name = parent_zone - - if is_valid_resource_id(parent_zone): - id_parts = parse_resource_id(parent_zone) - parent_rg = id_parts['resource_group'] - parent_subscription_id = id_parts['subscription'] - parent_zone_name = id_parts['name'] - - if all([parent_zone_name, parent_rg, child_zone_name, child_zone]) and child_zone_name.endswith(parent_zone_name): - record_set_name = child_zone_name.replace('.' + parent_zone_name, '') - try: - for dname in child_zone.name_servers: - add_dns_ns_record(cmd, parent_rg, parent_zone_name, record_set_name, dname, parent_subscription_id) - print('Delegation added succesfully in \'{}\'\n'.format(parent_zone_name), file=sys.stderr) - except HttpResponseError as ex: - logger.error(ex) - print('Could not add delegation in \'{}\'\n'.format(parent_zone_name), file=sys.stderr) - - -def create_dns_zone(cmd, client, resource_group_name, zone_name, parent_zone_name=None, tags=None, - if_none_match=False, zone_type='Public', resolution_vnets=None, registration_vnets=None): - Zone = cmd.get_models('Zone', resource_type=ResourceType.MGMT_NETWORK_DNS) - zone = Zone(location='global', tags=tags) - - if hasattr(zone, 'zone_type'): - zone.zone_type = zone_type - zone.registration_virtual_networks = registration_vnets - zone.resolution_virtual_networks = resolution_vnets - - created_zone = client.create_or_update(resource_group_name, zone_name, zone, - if_none_match='*' if if_none_match else None) - - if cmd.supported_api_version(min_api='2016-04-01') and parent_zone_name is not None: - logger.info('Attempting to add delegation in the parent zone') - add_dns_delegation(cmd, created_zone, parent_zone_name, resource_group_name, zone_name) - return created_zone - - -def update_dns_zone(instance, tags=None, zone_type=None, resolution_vnets=None, registration_vnets=None): - - if tags is not None: - instance.tags = tags - - if zone_type: - instance.zone_type = zone_type - - if resolution_vnets == ['']: - instance.resolution_virtual_networks = None - elif resolution_vnets: - instance.resolution_virtual_networks = resolution_vnets - - if registration_vnets == ['']: - instance.registration_virtual_networks = None - elif registration_vnets: - instance.registration_virtual_networks = registration_vnets - return instance - - -def list_dns_zones(cmd, resource_group_name=None): - ncf = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_NETWORK_DNS).zones - if resource_group_name: - return ncf.list_by_resource_group(resource_group_name) - return ncf.list() - - -def create_dns_record_set(cmd, resource_group_name, zone_name, record_set_name, record_set_type, - metadata=None, if_match=None, if_none_match=None, ttl=3600, target_resource=None): - - RecordSet = cmd.get_models('RecordSet', resource_type=ResourceType.MGMT_NETWORK_DNS) - SubResource = cmd.get_models('SubResource', resource_type=ResourceType.MGMT_NETWORK) - client = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_NETWORK_DNS).record_sets - record_set = RecordSet( - ttl=ttl, - metadata=metadata, - target_resource=SubResource(id=target_resource) if target_resource else None - ) - return client.create_or_update(resource_group_name, zone_name, record_set_name, - record_set_type, record_set, if_match=if_match, - if_none_match='*' if if_none_match else None) - - -def list_dns_record_set(client, resource_group_name, zone_name, record_type=None): - if record_type: - return client.list_by_type(resource_group_name, zone_name, record_type) - - return client.list_by_dns_zone(resource_group_name, zone_name) - - -def update_dns_record_set(instance, cmd, metadata=None, target_resource=None): - if metadata is not None: - instance.metadata = metadata - if target_resource == '': - instance.target_resource = None - elif target_resource is not None: - SubResource = cmd.get_models('SubResource') - instance.target_resource = SubResource(id=target_resource) - return instance - - -def _type_to_property_name(key): - type_dict = { - 'a': 'a_records', - 'aaaa': 'aaaa_records', - 'caa': 'caa_records', - 'cname': 'cname_record', - 'mx': 'mx_records', - 'ns': 'ns_records', - 'ptr': 'ptr_records', - 'soa': 'soa_record', - 'spf': 'txt_records', - 'srv': 'srv_records', - 'txt': 'txt_records', - 'alias': 'target_resource', - } - return type_dict[key.lower()] - - -def export_zone(cmd, resource_group_name, zone_name, file_name=None): # pylint: disable=too-many-branches - from time import localtime, strftime - - client = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_NETWORK_DNS) - record_sets = client.record_sets.list_by_dns_zone(resource_group_name, zone_name) - - zone_obj = OrderedDict({ - '$origin': zone_name.rstrip('.') + '.', - 'resource-group': resource_group_name, - 'zone-name': zone_name.rstrip('.'), - 'datetime': strftime('%a, %d %b %Y %X %z', localtime()) - }) - - for record_set in record_sets: - record_type = record_set.type.rsplit('/', 1)[1].lower() - record_set_name = record_set.name - record_data = getattr(record_set, _type_to_property_name(record_type), None) - - if not record_data: - record_data = [] - if not isinstance(record_data, list): - record_data = [record_data] - - if record_set_name not in zone_obj: - zone_obj[record_set_name] = OrderedDict() - - for record in record_data: - record_obj = {'ttl': record_set.ttl} - - if record_type not in zone_obj[record_set_name]: - zone_obj[record_set_name][record_type] = [] - if record_type == 'aaaa': - record_obj.update({'ip': record.ipv6_address}) - elif record_type == 'a': - record_obj.update({'ip': record.ipv4_address}) - elif record_type == 'caa': - record_obj.update({'val': record.value, 'tag': record.tag, 'flags': record.flags}) - elif record_type == 'cname': - record_obj.update({'alias': record.cname.rstrip('.') + '.'}) - elif record_type == 'mx': - record_obj.update({'preference': record.preference, 'host': record.exchange.rstrip('.') + '.'}) - elif record_type == 'ns': - record_obj.update({'host': record.nsdname.rstrip('.') + '.'}) - elif record_type == 'ptr': - record_obj.update({'host': record.ptrdname.rstrip('.') + '.'}) - elif record_type == 'soa': - record_obj.update({ - 'mname': record.host.rstrip('.') + '.', - 'rname': record.email.rstrip('.') + '.', - 'serial': int(record.serial_number), 'refresh': record.refresh_time, - 'retry': record.retry_time, 'expire': record.expire_time, - 'minimum': record.minimum_ttl - }) - zone_obj['$ttl'] = record.minimum_ttl - elif record_type == 'srv': - record_obj.update({'priority': record.priority, 'weight': record.weight, - 'port': record.port, 'target': record.target.rstrip('.') + '.'}) - elif record_type == 'txt': - record_obj.update({'txt': ''.join(record.value)}) - zone_obj[record_set_name][record_type].append(record_obj) - - if len(record_data) == 0: - record_obj = {'ttl': record_set.ttl} - - if record_type not in zone_obj[record_set_name]: - zone_obj[record_set_name][record_type] = [] - # Checking for alias record - if (record_type == 'a' or record_type == 'aaaa' or record_type == 'cname') and record_set.target_resource.id: - target_resource_id = record_set.target_resource.id - record_obj.update({'target-resource-id': record_type.upper() + " " + target_resource_id}) - record_type = 'alias' - if record_type not in zone_obj[record_set_name]: - zone_obj[record_set_name][record_type] = [] - elif record_type == 'aaaa' or record_type == 'a': - record_obj.update({'ip': ''}) - elif record_type == 'cname': - record_obj.update({'alias': ''}) - zone_obj[record_set_name][record_type].append(record_obj) - zone_file_content = make_zone_file(zone_obj) - print(zone_file_content) - if file_name: - try: - with open(file_name, 'w') as f: - f.write(zone_file_content) - except OSError: - raise CLIError('Unable to export to file: {}'.format(file_name)) - - -# pylint: disable=too-many-return-statements, inconsistent-return-statements, too-many-branches -def _build_record(cmd, data): - ( - AaaaRecord, - ARecord, - CaaRecord, - CnameRecord, - MxRecord, - NsRecord, - PtrRecord, - SoaRecord, - SrvRecord, - TxtRecord, - SubResource, - ) = cmd.get_models( - "AaaaRecord", - "ARecord", - "CaaRecord", - "CnameRecord", - "MxRecord", - "NsRecord", - "PtrRecord", - "SoaRecord", - "SrvRecord", - "TxtRecord", - "SubResource", - resource_type=ResourceType.MGMT_NETWORK_DNS, - ) - record_type = data['delim'].lower() - try: - if record_type == 'aaaa': - return AaaaRecord(ipv6_address=data['ip']) - if record_type == 'a': - return ARecord(ipv4_address=data['ip']) - if (record_type == 'caa' and - supported_api_version(cmd.cli_ctx, ResourceType.MGMT_NETWORK_DNS, min_api='2018-03-01-preview')): - return CaaRecord(value=data['val'], flags=int(data['flags']), tag=data['tag']) - if record_type == 'cname': - return CnameRecord(cname=data['alias']) - if record_type == 'mx': - return MxRecord(preference=data['preference'], exchange=data['host']) - if record_type == 'ns': - return NsRecord(nsdname=data['host']) - if record_type == 'ptr': - return PtrRecord(ptrdname=data['host']) - if record_type == 'soa': - return SoaRecord(host=data['host'], email=data['email'], serial_number=data['serial'], - refresh_time=data['refresh'], retry_time=data['retry'], expire_time=data['expire'], - minimum_ttl=data['minimum']) - if record_type == 'srv': - return SrvRecord( - priority=int(data['priority']), weight=int(data['weight']), port=int(data['port']), - target=data['target']) - if record_type in ['txt', 'spf']: - text_data = data['txt'] - return TxtRecord(value=text_data) if isinstance(text_data, list) else TxtRecord(value=[text_data]) - if record_type == 'alias': - return SubResource(id=data["resourceId"]) - except KeyError as ke: - raise CLIError("The {} record '{}' is missing a property. {}" - .format(record_type, data['name'], ke)) - - -# pylint: disable=too-many-statements -def import_zone(cmd, resource_group_name, zone_name, file_name): - from azure.cli.core.util import read_file_content - from azure.core.exceptions import HttpResponseError - import sys - logger.warning("In the future, zone name will be case insensitive.") - RecordSet = cmd.get_models('RecordSet', resource_type=ResourceType.MGMT_NETWORK_DNS) - - from azure.cli.core.azclierror import FileOperationError, UnclassifiedUserFault - try: - file_text = read_file_content(file_name) - except FileNotFoundError: - raise FileOperationError("No such file: " + str(file_name)) - except IsADirectoryError: - raise FileOperationError("Is a directory: " + str(file_name)) - except PermissionError: - raise FileOperationError("Permission denied: " + str(file_name)) - except OSError as e: - raise UnclassifiedUserFault(e) - - zone_obj = parse_zone_file(file_text, zone_name) - - origin = zone_name - record_sets = {} - for record_set_name in zone_obj: - for record_set_type in zone_obj[record_set_name]: - record_set_obj = zone_obj[record_set_name][record_set_type] - - if record_set_type == 'soa': - origin = record_set_name.rstrip('.') - - if not isinstance(record_set_obj, list): - record_set_obj = [record_set_obj] - - for entry in record_set_obj: - - record_set_ttl = entry['ttl'] - record_set_key = '{}{}'.format(record_set_name.lower(), record_set_type) - alias_record_type = entry.get("aliasDelim", None) - - if alias_record_type: - alias_record_type = alias_record_type.lower() - record_set_key = '{}{}'.format(record_set_name.lower(), alias_record_type) - - record = _build_record(cmd, entry) - if not record: - logger.warning('Cannot import %s. RecordType is not found. Skipping...', entry['delim'].lower()) - continue - - record_set = record_sets.get(record_set_key, None) - if not record_set: - - # Workaround for issue #2824 - relative_record_set_name = record_set_name.rstrip('.') - if not relative_record_set_name.endswith(origin): - logger.warning( - 'Cannot import %s. Only records relative to origin may be ' - 'imported at this time. Skipping...', relative_record_set_name) - continue - - record_set = RecordSet(ttl=record_set_ttl) - record_sets[record_set_key] = record_set - _add_record(record_set, record, record_set_type, - is_list=record_set_type.lower() not in ['soa', 'cname', 'alias']) - - total_records = 0 - for key, rs in record_sets.items(): - rs_name, rs_type = key.lower().rsplit('.', 1) - rs_name = rs_name[:-(len(origin) + 1)] if rs_name != origin else '@' - try: - record_count = len(getattr(rs, _type_to_property_name(rs_type))) - except TypeError: - record_count = 1 - total_records += record_count - cum_records = 0 - - client = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_NETWORK_DNS) - print('== BEGINNING ZONE IMPORT: {} ==\n'.format(zone_name), file=sys.stderr) - - Zone = cmd.get_models('Zone', resource_type=ResourceType.MGMT_NETWORK_DNS) - client.zones.create_or_update(resource_group_name, zone_name, Zone(location='global')) - for key, rs in record_sets.items(): - - rs_name, rs_type = key.lower().rsplit('.', 1) - rs_name = '@' if rs_name == origin else rs_name - if rs_name.endswith(origin): - rs_name = rs_name[:-(len(origin) + 1)] - - try: - record_count = len(getattr(rs, _type_to_property_name(rs_type))) - except TypeError: - record_count = 1 - if rs_name == '@' and rs_type == 'soa': - root_soa = client.record_sets.get(resource_group_name, zone_name, '@', 'SOA') - rs.soa_record.host = root_soa.soa_record.host - rs_name = '@' - elif rs_name == '@' and rs_type == 'ns': - root_ns = client.record_sets.get(resource_group_name, zone_name, '@', 'NS') - root_ns.ttl = rs.ttl - rs = root_ns - rs_type = rs.type.rsplit('/', 1)[1] - try: - client.record_sets.create_or_update( - resource_group_name, zone_name, rs_name, rs_type, rs) - cum_records += record_count - print("({}/{}) Imported {} records of type '{}' and name '{}'" - .format(cum_records, total_records, record_count, rs_type, rs_name), file=sys.stderr) - except HttpResponseError as ex: - logger.error(ex) - print("\n== {}/{} RECORDS IMPORTED SUCCESSFULLY: '{}' ==" - .format(cum_records, total_records, zone_name), file=sys.stderr) - - -def add_dns_aaaa_record(cmd, resource_group_name, zone_name, record_set_name, ipv6_address, - ttl=3600, if_none_match=None): - AaaaRecord = cmd.get_models('AaaaRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = AaaaRecord(ipv6_address=ipv6_address) - record_type = 'aaaa' - return _add_save_record(cmd, record, record_type, record_set_name, resource_group_name, zone_name, - ttl=ttl, if_none_match=if_none_match) - - -def add_dns_a_record(cmd, resource_group_name, zone_name, record_set_name, ipv4_address, - ttl=3600, if_none_match=None): - ARecord = cmd.get_models('ARecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = ARecord(ipv4_address=ipv4_address) - record_type = 'a' - return _add_save_record(cmd, record, record_type, record_set_name, resource_group_name, zone_name, 'arecords', - ttl=ttl, if_none_match=if_none_match) - - -def add_dns_caa_record(cmd, resource_group_name, zone_name, record_set_name, value, flags, tag, - ttl=3600, if_none_match=None): - CaaRecord = cmd.get_models('CaaRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = CaaRecord(flags=flags, tag=tag, value=value) - record_type = 'caa' - return _add_save_record(cmd, record, record_type, record_set_name, resource_group_name, zone_name, - ttl=ttl, if_none_match=if_none_match) - - -def add_dns_cname_record(cmd, resource_group_name, zone_name, record_set_name, cname, ttl=3600, if_none_match=None): - CnameRecord = cmd.get_models('CnameRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = CnameRecord(cname=cname) - record_type = 'cname' - return _add_save_record(cmd, record, record_type, record_set_name, resource_group_name, zone_name, - is_list=False, ttl=ttl, if_none_match=if_none_match) - - -def add_dns_mx_record(cmd, resource_group_name, zone_name, record_set_name, preference, exchange, - ttl=3600, if_none_match=None): - MxRecord = cmd.get_models('MxRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = MxRecord(preference=int(preference), exchange=exchange) - record_type = 'mx' - return _add_save_record(cmd, record, record_type, record_set_name, resource_group_name, zone_name, - ttl=ttl, if_none_match=if_none_match) - - -def add_dns_ns_record(cmd, resource_group_name, zone_name, record_set_name, dname, - subscription_id=None, ttl=3600, if_none_match=None): - NsRecord = cmd.get_models('NsRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = NsRecord(nsdname=dname) - record_type = 'ns' - return _add_save_record(cmd, record, record_type, record_set_name, resource_group_name, zone_name, - subscription_id=subscription_id, ttl=ttl, if_none_match=if_none_match) - - -def add_dns_ptr_record(cmd, resource_group_name, zone_name, record_set_name, dname, ttl=3600, if_none_match=None): - PtrRecord = cmd.get_models('PtrRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = PtrRecord(ptrdname=dname) - record_type = 'ptr' - return _add_save_record(cmd, record, record_type, record_set_name, resource_group_name, zone_name, - ttl=ttl, if_none_match=if_none_match) - - -def update_dns_soa_record(cmd, resource_group_name, zone_name, host=None, email=None, - serial_number=None, refresh_time=None, retry_time=None, expire_time=None, - minimum_ttl=3600, if_none_match=None): - record_set_name = '@' - record_type = 'soa' - - ncf = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_NETWORK_DNS).record_sets - record_set = ncf.get(resource_group_name, zone_name, record_set_name, record_type) - record = record_set.soa_record - - record.host = host or record.host - record.email = email or record.email - record.serial_number = serial_number or record.serial_number - record.refresh_time = refresh_time or record.refresh_time - record.retry_time = retry_time or record.retry_time - record.expire_time = expire_time or record.expire_time - record.minimum_ttl = minimum_ttl or record.minimum_ttl - - return _add_save_record(cmd, record, record_type, record_set_name, resource_group_name, zone_name, - is_list=False, if_none_match=if_none_match) - - -def add_dns_srv_record(cmd, resource_group_name, zone_name, record_set_name, priority, weight, - port, target, if_none_match=None): - SrvRecord = cmd.get_models('SrvRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = SrvRecord(priority=priority, weight=weight, port=port, target=target) - record_type = 'srv' - return _add_save_record(cmd, record, record_type, record_set_name, resource_group_name, zone_name, - if_none_match=if_none_match) - - -def add_dns_txt_record(cmd, resource_group_name, zone_name, record_set_name, value, if_none_match=None): - TxtRecord = cmd.get_models('TxtRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = TxtRecord(value=value) - record_type = 'txt' - long_text = ''.join(x for x in record.value) - original_len = len(long_text) - record.value = [] - while len(long_text) > 255: - record.value.append(long_text[:255]) - long_text = long_text[255:] - record.value.append(long_text) - final_str = ''.join(record.value) - final_len = len(final_str) - assert original_len == final_len - return _add_save_record(cmd, record, record_type, record_set_name, resource_group_name, zone_name, - if_none_match=if_none_match) - - -def remove_dns_aaaa_record(cmd, resource_group_name, zone_name, record_set_name, ipv6_address, - keep_empty_record_set=False): - AaaaRecord = cmd.get_models('AaaaRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = AaaaRecord(ipv6_address=ipv6_address) - record_type = 'aaaa' - return _remove_record(cmd.cli_ctx, record, record_type, record_set_name, resource_group_name, zone_name, - keep_empty_record_set=keep_empty_record_set) - - -def remove_dns_a_record(cmd, resource_group_name, zone_name, record_set_name, ipv4_address, - keep_empty_record_set=False): - ARecord = cmd.get_models('ARecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = ARecord(ipv4_address=ipv4_address) - record_type = 'a' - return _remove_record(cmd.cli_ctx, record, record_type, record_set_name, resource_group_name, zone_name, - keep_empty_record_set=keep_empty_record_set) - - -def remove_dns_caa_record(cmd, resource_group_name, zone_name, record_set_name, value, - flags, tag, keep_empty_record_set=False): - CaaRecord = cmd.get_models('CaaRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = CaaRecord(flags=flags, tag=tag, value=value) - record_type = 'caa' - return _remove_record(cmd.cli_ctx, record, record_type, record_set_name, resource_group_name, zone_name, - keep_empty_record_set=keep_empty_record_set) - - -def remove_dns_cname_record(cmd, resource_group_name, zone_name, record_set_name, cname, - keep_empty_record_set=False): - CnameRecord = cmd.get_models('CnameRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = CnameRecord(cname=cname) - record_type = 'cname' - return _remove_record(cmd.cli_ctx, record, record_type, record_set_name, resource_group_name, zone_name, - is_list=False, keep_empty_record_set=keep_empty_record_set) - - -def remove_dns_mx_record(cmd, resource_group_name, zone_name, record_set_name, preference, exchange, - keep_empty_record_set=False): - MxRecord = cmd.get_models('MxRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = MxRecord(preference=int(preference), exchange=exchange) - record_type = 'mx' - return _remove_record(cmd.cli_ctx, record, record_type, record_set_name, resource_group_name, zone_name, - keep_empty_record_set=keep_empty_record_set) - - -def remove_dns_ns_record(cmd, resource_group_name, zone_name, record_set_name, dname, - keep_empty_record_set=False): - NsRecord = cmd.get_models('NsRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = NsRecord(nsdname=dname) - record_type = 'ns' - return _remove_record(cmd.cli_ctx, record, record_type, record_set_name, resource_group_name, zone_name, - keep_empty_record_set=keep_empty_record_set) - - -def remove_dns_ptr_record(cmd, resource_group_name, zone_name, record_set_name, dname, - keep_empty_record_set=False): - PtrRecord = cmd.get_models('PtrRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = PtrRecord(ptrdname=dname) - record_type = 'ptr' - return _remove_record(cmd.cli_ctx, record, record_type, record_set_name, resource_group_name, zone_name, - keep_empty_record_set=keep_empty_record_set) - - -def remove_dns_srv_record(cmd, resource_group_name, zone_name, record_set_name, priority, weight, - port, target, keep_empty_record_set=False): - SrvRecord = cmd.get_models('SrvRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = SrvRecord(priority=priority, weight=weight, port=port, target=target) - record_type = 'srv' - return _remove_record(cmd.cli_ctx, record, record_type, record_set_name, resource_group_name, zone_name, - keep_empty_record_set=keep_empty_record_set) - - -def remove_dns_txt_record(cmd, resource_group_name, zone_name, record_set_name, value, - keep_empty_record_set=False): - TxtRecord = cmd.get_models('TxtRecord', resource_type=ResourceType.MGMT_NETWORK_DNS) - record = TxtRecord(value=value) - record_type = 'txt' - return _remove_record(cmd.cli_ctx, record, record_type, record_set_name, resource_group_name, zone_name, - keep_empty_record_set=keep_empty_record_set) - - -def _check_a_record_exist(record, exist_list): - for r in exist_list: - if r.ipv4_address == record.ipv4_address: - return True - return False - - -def _check_aaaa_record_exist(record, exist_list): - for r in exist_list: - if r.ipv6_address == record.ipv6_address: - return True - return False - - -def _check_caa_record_exist(record, exist_list): - for r in exist_list: - if (r.flags == record.flags and - r.tag == record.tag and - r.value == record.value): - return True - return False - - -def _check_cname_record_exist(record, exist_list): - for r in exist_list: - if r.cname == record.cname: - return True - return False - - -def _check_mx_record_exist(record, exist_list): - for r in exist_list: - if (r.preference == record.preference and - r.exchange == record.exchange): - return True - return False - - -def _check_ns_record_exist(record, exist_list): - for r in exist_list: - if r.nsdname == record.nsdname: - return True - return False - - -def _check_ptr_record_exist(record, exist_list): - for r in exist_list: - if r.ptrdname == record.ptrdname: - return True - return False - - -def _check_srv_record_exist(record, exist_list): - for r in exist_list: - if (r.priority == record.priority and - r.weight == record.weight and - r.port == record.port and - r.target == record.target): - return True - return False - - -def _check_txt_record_exist(record, exist_list): - for r in exist_list: - if r.value == record.value: - return True - return False - - -def _record_exist_func(record_type): - return globals()["_check_{}_record_exist".format(record_type)] - - -def _add_record(record_set, record, record_type, is_list=False): - record_property = _type_to_property_name(record_type) - - if is_list: - record_list = getattr(record_set, record_property) - if record_list is None: - setattr(record_set, record_property, []) - record_list = getattr(record_set, record_property) - - _record_exist = _record_exist_func(record_type) - if not _record_exist(record, record_list): - record_list.append(record) - else: - setattr(record_set, record_property, record) - - -def _add_save_record(cmd, record, record_type, record_set_name, resource_group_name, zone_name, - is_list=True, subscription_id=None, ttl=None, if_none_match=None): - from azure.core.exceptions import HttpResponseError - ncf = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_NETWORK_DNS, - subscription_id=subscription_id).record_sets - - try: - record_set = ncf.get(resource_group_name, zone_name, record_set_name, record_type) - except HttpResponseError: - RecordSet = cmd.get_models('RecordSet', resource_type=ResourceType.MGMT_NETWORK_DNS) - record_set = RecordSet(ttl=3600) - - if ttl is not None: - record_set.ttl = ttl - - _add_record(record_set, record, record_type, is_list) - - return ncf.create_or_update(resource_group_name, zone_name, record_set_name, - record_type, record_set, - if_none_match='*' if if_none_match else None) - - -def _remove_record(cli_ctx, record, record_type, record_set_name, resource_group_name, zone_name, - keep_empty_record_set, is_list=True): - ncf = get_mgmt_service_client(cli_ctx, ResourceType.MGMT_NETWORK_DNS).record_sets - record_set = ncf.get(resource_group_name, zone_name, record_set_name, record_type) - record_property = _type_to_property_name(record_type) - - if is_list: - record_list = getattr(record_set, record_property) - if record_list is not None: - keep_list = [r for r in record_list - if not dict_matches_filter(r.__dict__, record.__dict__)] - if len(keep_list) == len(record_list): - raise CLIError('Record {} not found.'.format(str(record))) - setattr(record_set, record_property, keep_list) - else: - setattr(record_set, record_property, None) - - if is_list: - records_remaining = len(getattr(record_set, record_property)) - else: - records_remaining = 1 if getattr(record_set, record_property) is not None else 0 - - if not records_remaining and not keep_empty_record_set: - logger.info('Removing empty %s record set: %s', record_type, record_set_name) - return ncf.delete(resource_group_name, zone_name, record_set_name, record_type) - - return ncf.create_or_update(resource_group_name, zone_name, record_set_name, record_type, record_set) - - -def dict_matches_filter(d, filter_dict): - sentinel = object() - return all(not filter_dict.get(key, None) or - str(filter_dict[key]) == str(d.get(key, sentinel)) or - lists_match(filter_dict[key], d.get(key, [])) - for key in filter_dict) - - -def lists_match(l1, l2): - try: - return Counter(l1) == Counter(l2) # pylint: disable=too-many-function-args - except TypeError: - return False -# endregion - - -# region LoadBalancers -def create_load_balancer(cmd, load_balancer_name, resource_group_name, location=None, tags=None, - backend_pool_name=None, frontend_ip_name='LoadBalancerFrontEnd', - private_ip_address=None, public_ip_address=None, - public_ip_address_allocation=None, - public_ip_dns_name=None, subnet=None, subnet_address_prefix='10.0.0.0/24', - virtual_network_name=None, vnet_address_prefix='10.0.0.0/16', - public_ip_address_type=None, subnet_type=None, validate=False, - no_wait=False, sku=None, frontend_ip_zone=None, public_ip_zone=None, - private_ip_address_version=None, edge_zone=None): - from azure.cli.core.util import random_string - from azure.cli.core.commands.arm import ArmTemplateBuilder - from azure.cli.command_modules.network.azure_stack._template_builder import ( - build_load_balancer_resource, build_public_ip_resource, build_vnet_resource) - - DeploymentProperties = cmd.get_models('DeploymentProperties', resource_type=ResourceType.MGMT_RESOURCE_RESOURCES) - - if public_ip_address is None: - logger.warning( - "Please note that the default public IP used for creation will be changed from Basic to Standard " - "in the future." - ) - - tags = tags or {} - public_ip_address = public_ip_address or 'PublicIP{}'.format(load_balancer_name) - backend_pool_name = backend_pool_name or '{}bepool'.format(load_balancer_name) - if not public_ip_address_allocation: - public_ip_address_allocation = 'Static' if (sku and sku.lower() == 'standard') else 'Dynamic' - - # Build up the ARM template - master_template = ArmTemplateBuilder() - lb_dependencies = [] - - public_ip_id = public_ip_address if is_valid_resource_id(public_ip_address) else None - subnet_id = subnet if is_valid_resource_id(subnet) else None - private_ip_allocation = 'Static' if private_ip_address else 'Dynamic' - - network_id_template = resource_id( - subscription=get_subscription_id(cmd.cli_ctx), resource_group=resource_group_name, - namespace='Microsoft.Network') - - if edge_zone and cmd.supported_api_version(min_api='2020-08-01'): - edge_zone_type = 'EdgeZone' - else: - edge_zone_type = None - - if subnet_type == 'new': - lb_dependencies.append('Microsoft.Network/virtualNetworks/{}'.format(virtual_network_name)) - vnet = build_vnet_resource( - cmd, virtual_network_name, location, tags, vnet_address_prefix, subnet, - subnet_address_prefix) - master_template.add_resource(vnet) - subnet_id = '{}/virtualNetworks/{}/subnets/{}'.format( - network_id_template, virtual_network_name, subnet) - - if public_ip_address_type == 'new': - lb_dependencies.append('Microsoft.Network/publicIpAddresses/{}'.format(public_ip_address)) - master_template.add_resource(build_public_ip_resource(cmd, public_ip_address, location, - tags, - public_ip_address_allocation, - public_ip_dns_name, - sku, public_ip_zone, None, edge_zone, edge_zone_type)) - public_ip_id = '{}/publicIPAddresses/{}'.format(network_id_template, - public_ip_address) - - load_balancer_resource = build_load_balancer_resource( - cmd, load_balancer_name, location, tags, backend_pool_name, frontend_ip_name, - public_ip_id, subnet_id, private_ip_address, private_ip_allocation, sku, - frontend_ip_zone, private_ip_address_version, None, edge_zone, edge_zone_type) - load_balancer_resource['dependsOn'] = lb_dependencies - master_template.add_resource(load_balancer_resource) - master_template.add_output('loadBalancer', load_balancer_name, output_type='object') - - template = master_template.build() - - # deploy ARM template - deployment_name = 'lb_deploy_' + random_string(32) - client = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES).deployments - properties = DeploymentProperties(template=template, parameters={}, mode='incremental') - Deployment = cmd.get_models('Deployment', resource_type=ResourceType.MGMT_RESOURCE_RESOURCES) - deployment = Deployment(properties=properties) - - if validate: - _log_pprint_template(template) - if cmd.supported_api_version(min_api='2019-10-01', resource_type=ResourceType.MGMT_RESOURCE_RESOURCES): - from azure.cli.core.commands import LongRunningOperation - validation_poller = client.begin_validate(resource_group_name, deployment_name, deployment) - return LongRunningOperation(cmd.cli_ctx)(validation_poller) - - return client.validate(resource_group_name, deployment_name, deployment) - - return sdk_no_wait(no_wait, client.begin_create_or_update, resource_group_name, deployment_name, deployment) -# endregion - - -# workaround for : https://github.com/Azure/azure-cli/issues/17071 -def lb_get(client, resource_group_name, load_balancer_name): - lb = client.get(resource_group_name, load_balancer_name) - return lb_get_operation(lb) - - -# workaround for : https://github.com/Azure/azure-cli/issues/17071 -def lb_get_operation(lb): - for item in lb.frontend_ip_configurations: - if item.zones is not None and len(item.zones) >= 3 and item.subnet is None: - item.zones = None - - return lb - - -def _get_nic_ip_config(nic, name): - if nic.ip_configurations: - ip_config = next( - (x for x in nic.ip_configurations if x.name.lower() == name.lower()), None) - else: - ip_config = None - if not ip_config: - raise CLIError('IP configuration {} not found.'.format(name)) - return ip_config - - -# region VirtualNetworkGatewayConnections -# pylint: disable=too-many-locals -def create_vpn_connection(cmd, resource_group_name, connection_name, vnet_gateway1, - location=None, tags=None, no_wait=False, validate=False, - vnet_gateway2=None, express_route_circuit2=None, local_gateway2=None, - authorization_key=None, enable_bgp=False, routing_weight=10, - connection_type=None, shared_key=None, - use_policy_based_traffic_selectors=False, - express_route_gateway_bypass=None, ingress_nat_rule=None, egress_nat_rule=None): - from azure.cli.core.util import random_string - from azure.cli.core.commands.arm import ArmTemplateBuilder - from azure.cli.command_modules.network.azure_stack._template_builder import build_vpn_connection_resource - - DeploymentProperties = cmd.get_models('DeploymentProperties', resource_type=ResourceType.MGMT_RESOURCE_RESOURCES) - tags = tags or {} - - # Build up the ARM template - master_template = ArmTemplateBuilder() - vpn_connection_resource = build_vpn_connection_resource( - cmd, connection_name, location, tags, vnet_gateway1, - vnet_gateway2 or local_gateway2 or express_route_circuit2, - connection_type, authorization_key, enable_bgp, routing_weight, shared_key, - use_policy_based_traffic_selectors, express_route_gateway_bypass, ingress_nat_rule, egress_nat_rule) - master_template.add_resource(vpn_connection_resource) - master_template.add_output('resource', connection_name, output_type='object') - if shared_key: - master_template.add_secure_parameter('sharedKey', shared_key) - if authorization_key: - master_template.add_secure_parameter('authorizationKey', authorization_key) - - template = master_template.build() - parameters = master_template.build_parameters() - - # deploy ARM template - deployment_name = 'vpn_connection_deploy_' + random_string(32) - client = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES).deployments - properties = DeploymentProperties(template=template, parameters=parameters, mode='incremental') - Deployment = cmd.get_models('Deployment', resource_type=ResourceType.MGMT_RESOURCE_RESOURCES) - deployment = Deployment(properties=properties) - - if validate: - _log_pprint_template(template) - if cmd.supported_api_version(min_api='2019-10-01', resource_type=ResourceType.MGMT_RESOURCE_RESOURCES): - from azure.cli.core.commands import LongRunningOperation - validation_poller = client.begin_validate(resource_group_name, deployment_name, deployment) - return LongRunningOperation(cmd.cli_ctx)(validation_poller) - - return client.validate(resource_group_name, deployment_name, deployment) - - return sdk_no_wait(no_wait, client.begin_create_or_update, resource_group_name, deployment_name, deployment) -# endregion diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/private_link_resource_and_endpoint_connections/__init__.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/private_link_resource_and_endpoint_connections/__init__.py deleted file mode 100644 index 34913fb394d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/private_link_resource_and_endpoint_connections/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/private_link_resource_and_endpoint_connections/custom.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/private_link_resource_and_endpoint_connections/custom.py deleted file mode 100644 index d00a8725907..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/private_link_resource_and_endpoint_connections/custom.py +++ /dev/null @@ -1,148 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -from knack.util import CLIError - -from .resource_providers import GeneralPrivateEndpointClient - - -TYPE_CLIENT_MAPPING = { - # 'Microsoft.Keyvault/vaults': KeyVaultPrivateEndpointClient # vaults -} - - -# pylint: disable=too-many-statements -def register_providers(): - _register_one_provider("Microsoft.AgFoodPlatform/farmBeats", "2021-09-01-preview", True) - _register_one_provider("Microsoft.Automation/automationAccounts", "2020-01-13-preview", True) - _register_one_provider('Microsoft.Authorization/resourceManagementPrivateLinks', '2020-05-01', True) - _register_one_provider('Microsoft.ApiManagement/service', '2021-08-01', True) - _register_one_provider('Microsoft.AppConfiguration/configurationStores', '2020-06-01', True) - _register_one_provider("Microsoft.Batch/batchAccounts", "2023-11-01", True) - _register_one_provider("Microsoft.BotService/botServices", "2021-03-01", True) - _register_one_provider("Microsoft.Cache/Redis", "2021-06-01", True) - # "Microsoft.Cache/redisEnterprise", "2021-03-01", True - _register_one_provider('Microsoft.CognitiveServices/accounts', '2022-03-01', True) - _register_one_provider('Microsoft.Compute/diskAccesses', '2020-09-30', True) - _register_one_provider('Microsoft.ContainerRegistry/registries', '2019-12-01-preview', True) - _register_one_provider('Microsoft.Dashboard/grafana', '2022-05-01-preview', True) - _register_one_provider('Microsoft.DBforMySQL/servers', '2018-06-01', False, '2017-12-01-preview') - _register_one_provider('Microsoft.DBforMariaDB/servers', '2018-06-01', False) - _register_one_provider('Microsoft.DBforPostgreSQL/servers', '2018-06-01', False, '2017-12-01-preview') - _register_one_provider('Microsoft.Devices/IotHubs', '2020-03-01', True) - _register_one_provider('Microsoft.DeviceUpdate/accounts', '2020-03-01-preview', True) - _register_one_provider('Microsoft.DocumentDB/databaseAccounts', '2019-08-01-preview', False, '2020-03-01') - _register_one_provider('Microsoft.DigitalTwins/digitalTwinsInstances', '2020-12-01', True) - _register_one_provider('Microsoft.EventGrid/topics', '2020-04-01-preview', True) - _register_one_provider('Microsoft.EventGrid/domains', '2020-04-01-preview', True) - _register_one_provider("Microsoft.EventHub/namespaces", "2021-06-01-preview", True) - _register_one_provider("Microsoft.HDInsight/clusters", '2018-06-01-preview', True) - _register_one_provider("Microsoft.HybridCompute/privateLinkScopes", '2021-05-20', True) - _register_one_provider("Microsoft.HealthcareApis/services", "2020-03-30", True) - _register_one_provider('microsoft.insights/privateLinkScopes', '2019-10-17-preview', True) - _register_one_provider('Microsoft.KeyVault/managedHSMs', '2021-04-01-preview', True) - _register_one_provider('Microsoft.Keyvault/vaults', '2019-09-01', False) - _register_one_provider('Microsoft.MachineLearningServices/workspaces', '2021-01-01', True) - _register_one_provider("Microsoft.Media/mediaservices", "2021-06-01", True) - # _register_one_provider("Microsoft.Media/videoanalyzers", "2021-11-01-preview", True) - # "Microsoft.Migrate/assessmentProjects", "2020-05-01-preview", False - # "Microsoft.Migrate/migrateProjects", "2020-06-01-preview", False - _register_one_provider('Microsoft.Network/applicationGateways', '2020-05-01', True) - _register_one_provider('Microsoft.Network/privateLinkServices', '2021-05-01', True) - # "Microsoft.OffAzure/masterSites", "2020-07-07", False - _register_one_provider("Microsoft.Purview/accounts", "2021-07-01", True) - _register_one_provider('Microsoft.PowerBI/privateLinkServicesForPowerBI', '2020-06-01', False) - _register_one_provider('Microsoft.Search/searchServices', '2020-08-01', True) - _register_one_provider("Microsoft.ServiceBus/namespaces", "2021-06-01-preview", True) - _register_one_provider('Microsoft.SignalRService/signalr', '2020-05-01', False) - _register_one_provider('Microsoft.Sql/servers', '2018-06-01-preview', True) - _register_one_provider('Microsoft.Storage/storageAccounts', '2019-06-01', True) - _register_one_provider("Microsoft.StorageSync/storageSyncServices", "2020-03-01", True) - _register_one_provider("Microsoft.Synapse/workspaces", "2019-06-01-preview", True) - _register_one_provider('Microsoft.Web/sites', '2019-08-01', False) - _register_one_provider("Microsoft.Web/hostingEnvironments", "2020-10-01", True) - _register_one_provider('Microsoft.SignalRService/WebPubSub', '2021-09-01-preview', False) - _register_one_provider('Microsoft.DataFactory/factories', '2018-06-01', True) - _register_one_provider('Microsoft.Databricks/workspaces', '2021-04-01-preview', True) - _register_one_provider('Microsoft.RecoveryServices/vaults', '2021-07-01', True) - _register_one_provider('Microsoft.Kusto/clusters', '2021-08-27', True) - _register_one_provider("Microsoft.KubernetesConfiguration/privateLinkScopes", '2022-04-02-preview', True) - _register_one_provider("Microsoft.OpenEnergyPlatform/energyServices", '2022-04-04-preview', True) - - -def _register_one_provider(provider, api_version, support_list_or_not, resource_get_api_version=None, support_connection_operation=True): # pylint: disable=line-too-long - """ - :param provider: namespace + type. - :param api_version: API version for private link scenarios. - :param support_list_or_not: support list rest call or not. - :param resource_get_api_version: API version to get the service resource. - """ - general_client_settings = { - "api_version": api_version, - "support_list_or_not": support_list_or_not, - "resource_get_api_version": resource_get_api_version, - "support_connection_operation": support_connection_operation - } - - TYPE_CLIENT_MAPPING[provider] = general_client_settings - - -def _check_connection_operation_support(rp_mapping, resource_provider): - if resource_provider in rp_mapping \ - and isinstance(rp_mapping[resource_provider], dict) \ - and not rp_mapping[resource_provider]['support_connection_operation']: - raise CLIError("Resource provider {} currently does not support this operation".format(resource_provider)) - - -def _get_client(rp_mapping, resource_provider): - for key, value in rp_mapping.items(): - if str.lower(key) == str.lower(resource_provider): - if isinstance(value, dict): - return GeneralPrivateEndpointClient(key, - value['api_version'], - value['support_list_or_not'], - value['resource_get_api_version']) - return value() - raise CLIError("Resource type must be one of {}".format(", ".join(rp_mapping.keys()))) - - -def list_private_link_resource(cmd, resource_group_name, name, resource_provider): - client = _get_client(TYPE_CLIENT_MAPPING, resource_provider) - return client.list_private_link_resource(cmd, resource_group_name, name) - - -def approve_private_endpoint_connection(cmd, resource_group_name, resource_name, resource_provider, - name, approval_description=None): - _check_connection_operation_support(TYPE_CLIENT_MAPPING, resource_provider) - client = _get_client(TYPE_CLIENT_MAPPING, resource_provider) - return client.approve_private_endpoint_connection(cmd, resource_group_name, - resource_name, name, - approval_description) - - -def reject_private_endpoint_connection(cmd, resource_group_name, resource_name, resource_provider, - name, rejection_description=None): - _check_connection_operation_support(TYPE_CLIENT_MAPPING, resource_provider) - client = _get_client(TYPE_CLIENT_MAPPING, resource_provider) - return client.reject_private_endpoint_connection(cmd, resource_group_name, - resource_name, name, - rejection_description) - - -def remove_private_endpoint_connection(cmd, resource_group_name, resource_name, resource_provider, name): - _check_connection_operation_support(TYPE_CLIENT_MAPPING, resource_provider) - client = _get_client(TYPE_CLIENT_MAPPING, resource_provider) - return client.remove_private_endpoint_connection(cmd, resource_group_name, resource_name, name) - - -def show_private_endpoint_connection(cmd, resource_group_name, resource_name, resource_provider, name): - _check_connection_operation_support(TYPE_CLIENT_MAPPING, resource_provider) - client = _get_client(TYPE_CLIENT_MAPPING, resource_provider) - return client.show_private_endpoint_connection(cmd, resource_group_name, resource_name, name) - - -def list_private_endpoint_connection(cmd, resource_group_name, name, resource_provider): - client = _get_client(TYPE_CLIENT_MAPPING, resource_provider) - return client.list_private_endpoint_connection(cmd, resource_group_name, name) diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/private_link_resource_and_endpoint_connections/resource_providers/__init__.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/private_link_resource_and_endpoint_connections/resource_providers/__init__.py deleted file mode 100644 index fc93bc1170d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/private_link_resource_and_endpoint_connections/resource_providers/__init__.py +++ /dev/null @@ -1,185 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -import abc -import time -import json -from knack.log import get_logger -from azure.cli.core.util import send_raw_request - -logger = get_logger(__name__) -RETRY_MAX = 20 -RETRY_INTERVAL = 10 - - -class PrivateEndpointClient: - __metaclass__ = abc.ABCMeta - - @abc.abstractmethod - def list_private_link_resource(self, cmd, resource_group_name, name): - return - - @abc.abstractmethod - def approve_private_endpoint_connection(self, cmd, resource_group_name, resource_name, - name, approval_description=None): - return - - @abc.abstractmethod - def reject_private_endpoint_connection(self, cmd, resource_group_name, resource_name, - name, rejection_description=None): - return - - @abc.abstractmethod - def remove_private_endpoint_connection(self, cmd, resource_group_name, resource_name, name): - return - - @abc.abstractmethod - def show_private_endpoint_connection(self, cmd, resource_group_name, resource_name, name): - return - - -class GeneralPrivateEndpointClient(PrivateEndpointClient): - - def __init__(self, rp, api_version, support_list, resource_get_api_version=None): - self.rp = rp - self.api_version = api_version - self.support_list = support_list - # same with api_version or using specific api version to get resource - self.resource_get_api_version = resource_get_api_version or api_version - - def _update_private_endpoint_connection_status(self, cmd, resource_group_name, - resource_name, private_endpoint_connection_name, - is_approved=True, description=None): - - private_endpoint_connection = self.show_private_endpoint_connection(cmd, - resource_group_name, - resource_name, - private_endpoint_connection_name) - - new_status = "Approved" if is_approved else "Rejected" - private_endpoint_connection['properties']['privateLinkServiceConnectionState']['status'] = new_status - private_endpoint_connection['properties']['privateLinkServiceConnectionState']['description'] = description - - url = _build_connection_url_endpoint(resource_group_name, - self.rp, - resource_name, - private_endpoint_connection_name, - self.api_version) - r = send_raw_request(cmd.cli_ctx, 'put', url, body=json.dumps(private_endpoint_connection)) - query_counts = RETRY_MAX - while query_counts: - time.sleep(RETRY_INTERVAL) - query_counts -= 1 - private_endpoint_connection = self.show_private_endpoint_connection(cmd, - resource_group_name, - resource_name, - private_endpoint_connection_name) - if private_endpoint_connection['properties'].get('provisioningState', None) in ["Succeeded", "Ready"]: - if private_endpoint_connection['properties'].get( - 'privateLinkServiceConnectionState', {}).get('status', None) in [new_status]: - return private_endpoint_connection - logger.warning("Cannot query the state of private endpoint connection. " - "Please use `az network private-endpoint-connection show` command to check the status.") - return r.json() - - def list_private_link_resource(self, cmd, resource_group_name, name): - url = _build_link_resource_url_endpoint(resource_group_name, self.rp, name, self.api_version) - r = send_raw_request(cmd.cli_ctx, 'get', url) - try: - return r.json()['value'] - except KeyError: - pass - return r.json() - - def approve_private_endpoint_connection(self, cmd, resource_group_name, - resource_name, name, approval_description=None): - return self._update_private_endpoint_connection_status(cmd=cmd, - resource_group_name=resource_group_name, - resource_name=resource_name, - private_endpoint_connection_name=name, - is_approved=True, - description=approval_description) - - def reject_private_endpoint_connection(self, cmd, resource_group_name, - resource_name, name, rejection_description=None): - return self._update_private_endpoint_connection_status(cmd=cmd, - resource_group_name=resource_group_name, - resource_name=resource_name, - private_endpoint_connection_name=name, - is_approved=False, - description=rejection_description) - - def remove_private_endpoint_connection(self, cmd, resource_group_name, resource_name, name): - url = _build_connection_url_endpoint(resource_group_name, self.rp, resource_name, name, self.api_version) - r = send_raw_request(cmd.cli_ctx, 'delete', url) - if r.status_code in [201, 202, 204]: - logger.warning('Deleting operation is asynchronous. ' - 'Please use `az network private-endpoint-connection show to query the status.') - - def show_private_endpoint_connection(self, cmd, resource_group_name, resource_name, name): - url = _build_connection_url_endpoint(resource_group_name, self.rp, resource_name, name, self.api_version) - r = send_raw_request(cmd.cli_ctx, 'get', url) - return r.json() - - def list_private_endpoint_connection(self, cmd, resource_group_name, resource_name): - if self.support_list: - url = _build_connections_url_endpoint(resource_group_name, self.rp, resource_name, self.api_version) - r = send_raw_request(cmd.cli_ctx, 'get', url) - try: - return r.json()['value'] - except KeyError: - pass - return r.json() - url = _build_resource_url_endpoint(resource_group_name, self.rp, resource_name, self.resource_get_api_version) - r = send_raw_request(cmd.cli_ctx, 'get', url) - return r.json()['properties']['privateEndpointConnections'] - - -def _build_connection_url_endpoint(resource_group_name, namespace_type, resource_name, name, api_version): - connection_url_endpoint = "/subscriptions/{{subscriptionId}}/" \ - "resourceGroups/{resource_group_name}/" \ - "providers/{namespace_type}/" \ - "{resource_name}/privateEndpointConnections/" \ - "{name}?api-version={api_version}".format(resource_group_name=resource_group_name, - namespace_type=namespace_type, - resource_name=resource_name, - name=name, - api_version=api_version) - return connection_url_endpoint - - -def _build_link_resource_url_endpoint(resource_group_name, namespace_type, resource_name, api_version): - link_resource_url_endpoint = "/subscriptions/{{subscriptionId}}/" \ - "resourceGroups/{resource_group_name}/" \ - "providers/{namespace_type}/" \ - "{resource_name}/privateLinkResources" \ - "?api-version={api_version}".format(resource_group_name=resource_group_name, - namespace_type=namespace_type, - resource_name=resource_name, - api_version=api_version) - return link_resource_url_endpoint - - -def _build_connections_url_endpoint(resource_group_name, namespace_type, resource_name, api_version): - connections_url_endpoint = "/subscriptions/{{subscriptionId}}/" \ - "resourceGroups/{resource_group_name}/" \ - "providers/{namespace_type}/" \ - "{resource_name}/privateEndpointConnections" \ - "?api-version={api_version}".format(resource_group_name=resource_group_name, - namespace_type=namespace_type, - resource_name=resource_name, - api_version=api_version) - return connections_url_endpoint - - -def _build_resource_url_endpoint(resource_group_name, namespace_type, resource_name, api_version): - resource_url_endpoint = "/subscriptions/{{subscriptionId}}/" \ - "resourceGroups/{resource_group_name}/" \ - "providers/{namespace_type}/" \ - "{resource_name}" \ - "?api-version={api_version}".format(resource_group_name=resource_group_name, - namespace_type=namespace_type, - resource_name=resource_name, - api_version=api_version) - return resource_url_endpoint diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/private_link_resource_and_endpoint_connections/resource_providers/keyvault_provider.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/private_link_resource_and_endpoint_connections/resource_providers/keyvault_provider.py deleted file mode 100644 index aaf332b1f82..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/private_link_resource_and_endpoint_connections/resource_providers/keyvault_provider.py +++ /dev/null @@ -1,64 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -from azure.cli.core.profiles import ResourceType -from azure.cli.core.commands.client_factory import get_mgmt_service_client -from . import PrivateEndpointClient - - -def _update_private_endpoint_connection_status(cmd, client, resource_group_name, - vault_name, private_endpoint_connection_name, - is_approved=True, description=None): - PrivateEndpointServiceConnectionStatus = cmd.get_models('PrivateEndpointServiceConnectionStatus', - resource_type=ResourceType.MGMT_KEYVAULT) - - private_endpoint_connection = client.get(resource_group_name=resource_group_name, vault_name=vault_name, - private_endpoint_connection_name=private_endpoint_connection_name) - - new_status = PrivateEndpointServiceConnectionStatus.approved \ - if is_approved else PrivateEndpointServiceConnectionStatus.rejected - private_endpoint_connection.private_link_service_connection_state.status = new_status - private_endpoint_connection.private_link_service_connection_state.description = description - - return client.put(resource_group_name=resource_group_name, - vault_name=vault_name, - private_endpoint_connection_name=private_endpoint_connection_name, - properties=private_endpoint_connection) - - -class KeyVaultPrivateEndpointClient(PrivateEndpointClient): - - def list_private_link_resource(self, cmd, resource_group_name, name): - client = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_KEYVAULT).private_link_resources - return client.list_by_vault(resource_group_name, name) - - def approve_private_endpoint_connection(self, cmd, resource_group_name, - resource_name, name, approval_description=None): - client = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_KEYVAULT).private_endpoint_connections - return _update_private_endpoint_connection_status(cmd=cmd, - client=client, - resource_group_name=resource_group_name, - vault_name=resource_name, - private_endpoint_connection_name=name, - is_approved=True, - description=approval_description) - - def reject_private_endpoint_connection(self, cmd, resource_group_name, - resource_name, name, rejection_description=None): - client = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_KEYVAULT).private_endpoint_connections - return _update_private_endpoint_connection_status(cmd=cmd, - client=client, - resource_group_name=resource_group_name, - vault_name=resource_name, - private_endpoint_connection_name=name, - is_approved=False, - description=rejection_description) - - def remove_private_endpoint_connection(self, cmd, resource_group_name, resource_name, name): - client = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_KEYVAULT).private_endpoint_connections - return client.delete(resource_group_name, resource_name, name) - - def show_private_endpoint_connection(self, cmd, resource_group_name, resource_name, name): - client = get_mgmt_service_client(cmd.cli_ctx, ResourceType.MGMT_KEYVAULT).private_endpoint_connections - return client.get(resource_group_name, resource_name, name) diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/__init__.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/__init__.py deleted file mode 100644 index 34913fb394d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/_params.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/_params.py deleted file mode 100644 index 749b974106c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/_params.py +++ /dev/null @@ -1,9 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -# pylint: disable=unused-argument, too-many-locals, too-many-branches, too-many-statements -def load_arguments(self, _): - pass diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/commands.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/commands.py deleted file mode 100644 index 84670392b95..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/commands.py +++ /dev/null @@ -1,128 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -# pylint: disable=too-many-locals, too-many-statements, disable=line-too-long -def load_command_table(self, _): - from .operations import import_aaz_by_profile - - # region LoadBalancers - from .operations.load_balancer import LBFrontendIPCreate, LBFrontendIPUpdate - self.command_table["network lb frontend-ip create"] = LBFrontendIPCreate(loader=self) - self.command_table["network lb frontend-ip update"] = LBFrontendIPUpdate(loader=self) - - from .operations.load_balancer import LBInboundNatRuleCreate, LBInboundNatRuleUpdate - self.command_table["network lb inbound-nat-rule create"] = LBInboundNatRuleCreate(loader=self) - self.command_table["network lb inbound-nat-rule update"] = LBInboundNatRuleUpdate(loader=self) - - from .operations.load_balancer import LBInboundNatPoolCreate, LBInboundNatPoolUpdate - self.command_table["network lb inbound-nat-pool create"] = LBInboundNatPoolCreate(loader=self) - self.command_table["network lb inbound-nat-pool update"] = LBInboundNatPoolUpdate(loader=self) - - from .operations.load_balancer import LBRuleCreate, LBRuleUpdate - self.command_table["network lb rule create"] = LBRuleCreate(loader=self) - self.command_table["network lb rule update"] = LBRuleUpdate(loader=self) - - from .operations.load_balancer import LBProbeCreate, LBProbeUpdate - self.command_table["network lb probe create"] = LBProbeCreate(loader=self) - self.command_table["network lb probe update"] = LBProbeUpdate(loader=self) - - # endregion - - # region LocalNetworkGateways - local_gateway = import_aaz_by_profile("network.local_gateway") - - from .._format import transform_local_gateway_table_output - self.command_table['network local-gateway list'] = local_gateway.List( - loader=self, table_transformer=transform_local_gateway_table_output) - - # endregion - - # region NetworkInterfaces - operations_tmpl = self.get_module_name_by_profile("operations.nic#{}") - - from .operations.nic import NICCreate, NICUpdate - self.command_table["network nic create"] = NICCreate(loader=self) - self.command_table["network nic update"] = NICUpdate(loader=self) - - from .operations.nic import NICIPConfigCreate, NICIPConfigUpdate, NICIPConfigNATAdd, NICIPConfigNATRemove - self.command_table["network nic ip-config create"] = NICIPConfigCreate(loader=self) - self.command_table["network nic ip-config update"] = NICIPConfigUpdate(loader=self) - self.command_table["network nic ip-config inbound-nat-rule add"] = NICIPConfigNATAdd(loader=self) - self.command_table["network nic ip-config inbound-nat-rule remove"] = NICIPConfigNATRemove(loader=self) - - with self.command_group("network nic ip-config address-pool", operations_tmpl=operations_tmpl) as g: - g.custom_command("add", "add_nic_ip_config_address_pool") - g.custom_command("remove", "remove_nic_ip_config_address_pool") - - # endregion - - # region VirtualNetworkGatewayConnections - from .operations.vpn_connection import VpnConnSharedKeyUpdate - self.command_table['network vpn-connection shared-key update'] = VpnConnSharedKeyUpdate(loader=self) - - # endregion - - # region VirtualNetworkGateways - from .operations.vnet_gateway import VnetGatewayCreate, VnetGatewayUpdate - self.command_table['network vnet-gateway create'] = VnetGatewayCreate(loader=self) - self.command_table['network vnet-gateway update'] = VnetGatewayUpdate(loader=self) - - from .operations.vnet_gateway import VnetGatewayRevokedCertCreate - self.command_table['network vnet-gateway revoked-cert create'] = VnetGatewayRevokedCertCreate(loader=self) - - from .operations.vnet_gateway import VnetGatewayRootCertCreate - self.command_table['network vnet-gateway root-cert create'] = VnetGatewayRootCertCreate(loader=self) - - # region VirtualNetwork - from .operations.vnet import VNetCreate, VNetSubnetUpdate - from .._format import transform_vnet_table_output - vnet = import_aaz_by_profile("network.vnet") - self.command_table['network vnet create'] = VNetCreate(loader=self) - self.command_table['network vnet list'] = vnet.List(loader=self, table_transformer=transform_vnet_table_output) - - self.command_table['network vnet subnet update'] = VNetSubnetUpdate(loader=self) - - # endregion - - # region NetworkRoot - with self.command_group('network'): - from .operations.locations import UsagesList - from .._format import transform_network_usage_table - self.command_table['network list-usages'] = UsagesList(loader=self, - table_transformer=transform_network_usage_table) - # endregion - - # region PublicIPAddresses - public_ip_show_table_transform = '{Name:name, ResourceGroup:resourceGroup, Location:location, AddressVersion:publicIpAddressVersion, AllocationMethod:publicIpAllocationMethod, IdleTimeoutInMinutes:idleTimeoutInMinutes, ProvisioningState:provisioningState}' - - public_ip = import_aaz_by_profile("network.public_ip") - operations_tmpl = self.get_module_name_by_profile("operations.public_ip#{}") - from .._format import transform_public_ip_create_output - from .._validators import process_public_ip_create_namespace - - with self.command_group('network public-ip', operations_tmpl=operations_tmpl) as g: - g.custom_command("create", "create_public_ip", transform=transform_public_ip_create_output, - validator=process_public_ip_create_namespace) - - self.command_table['network public-ip list'] = public_ip.List(loader=self, - table_transformer='[].' + public_ip_show_table_transform) - self.command_table['network public-ip show'] = public_ip.Show(loader=self, - table_transformer=public_ip_show_table_transform) - - # endregion - - # region NetworkSecurityGroups - from .operations.nsg import NSGCreate, NSGRuleCreate - from .._format import transform_nsg_rule_table_output - operations_tmpl = self.get_module_name_by_profile("operations.nsg#{}") - nsgRule = import_aaz_by_profile("network.nsg.rule") - self.command_table["network nsg create"] = NSGCreate(loader=self) - - self.command_table["network nsg rule create"] = NSGRuleCreate(loader=self) - self.command_table["network nsg rule show"] = nsgRule.Show(loader=self, table_transformer=transform_nsg_rule_table_output) - with self.command_group("network nsg rule", operations_tmpl=operations_tmpl) as g: - g.custom_command("list", "list_nsg_rules", table_transformer=lambda x: [transform_nsg_rule_table_output(i) for i in x]) - # endregion diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/__init__.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/__init__.py deleted file mode 100644 index fca9bdf191e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-import -from ._util import import_aaz_by_profile diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/_util.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/_util.py deleted file mode 100644 index d6fd708b6d0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/_util.py +++ /dev/null @@ -1,9 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -import importlib - - -def import_aaz_by_profile(module_name): - return importlib.import_module(f"azure.cli.command_modules.network.aaz.profile_2017_03_09_profile.{module_name}") diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/load_balancer.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/load_balancer.py deleted file mode 100644 index e071cfbd9d0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/load_balancer.py +++ /dev/null @@ -1,296 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger -from azure.cli.core.azclierror import ArgumentUsageError -from azure.cli.core.aaz import AAZResourceIdArgFormat, has_value, AAZStrArg -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_LBFrontendIP = import_aaz_by_profile("network.lb.frontend_ip") - - -class LBFrontendIPCreate(_LBFrontendIP.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - arg_group="Properties", - options=['--vnet-name'], - help="The virtual network (VNet) associated with the subnet (Omit if supplying a subnet id)." - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}", - ) - - args_schema.private_ip_allocation_method._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.subnet) and has_value(args.public_ip_address): - raise ArgumentUsageError( - 'incorrect usage: --subnet NAME --vnet-name NAME | ' - '--subnet ID | --public-ip-address NAME_OR_ID') - - if not has_value(args.public_ip_address): - logger.warning( - "Please note that the default public IP used for LB frontend will be changed from Basic to Standard " - "in the future." - ) - - if has_value(args.private_ip_address): - args.private_ip_allocation_method = 'Static' - else: - args.private_ip_allocation_method = 'Dynamic' - - -class LBFrontendIPUpdate(_LBFrontendIP.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - arg_group="Properties", - options=['--vnet-name'], - help="The virtual network (VNet) associated with the subnet (Omit if supplying a subnet id)." - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}", - ) - - args_schema.private_ip_allocation_method._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.private_ip_address): - # update private_ip_address - if args.private_ip_address: - args.private_ip_allocation_method = 'Static' - else: - # set private_ip_address as null value - args.private_ip_allocation_method = 'Dynamic' - - def post_instance_update(self, instance): - if not has_value(instance.properties.subnet.id): - instance.properties.subnet = None - if not has_value(instance.properties.public_ip_address.id): - instance.properties.public_ip_address = None - - -_LBInboundNatPool = import_aaz_by_profile("network.lb.inbound_nat_pool") - - -class LBInboundNatPoolCreate(_LBInboundNatPool.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - - args_schema.protocol._required = True - args_schema.backend_port._required = True - args_schema.frontend_port_range_start._required = True - args_schema.frontend_port_range_end._required = True - return args_schema - - def pre_instance_create(self): - args = self.ctx.args - if not has_value(args.frontend_ip_name): - instance = self.ctx.vars.instance - frontend_ip_configurations = instance.properties.frontend_ip_configurations - if len(frontend_ip_configurations) == 1: - args.frontend_ip_name = instance.properties.frontend_ip_configurations[0].id - elif len(frontend_ip_configurations) > 1: - raise ArgumentUsageError("Multiple FrontendIpConfigurations found in loadbalancer. Specify --frontend-ip explicitly.") - - -class LBInboundNatPoolUpdate(_LBInboundNatPool.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - - args_schema.protocol._nullable = False - args_schema.backend_port._nullable = False - args_schema.frontend_port_range_start._nullable = False - args_schema.frontend_port_range_end._nullable = False - return args_schema - - def post_instance_update(self, instance): - if not has_value(instance.properties.frontend_ip_configuration.id): - instance.properties.frontend_ip_configuration = None - - -_LBInboundNatRule = import_aaz_by_profile("network.lb.inbound_nat_rule") - - -class LBInboundNatRuleCreate(_LBInboundNatRule.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - - # required for a public load balancer - args_schema.protocol._required = True - args_schema.backend_port._required = True - return args_schema - - def pre_instance_create(self): - args = self.ctx.args - if not has_value(args.frontend_ip_name): - instance = self.ctx.vars.instance - frontend_ip_configurations = instance.properties.frontend_ip_configurations - if len(frontend_ip_configurations) == 1: - args.frontend_ip_name = instance.properties.frontend_ip_configurations[0].id - elif len(frontend_ip_configurations) > 1: - raise ArgumentUsageError("Multiple FrontendIpConfigurations found in loadbalancer. Specify --frontend-ip explicitly.") - - -class LBInboundNatRuleUpdate(_LBInboundNatRule.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - return args_schema - - def post_instance_update(self, instance): - if not has_value(instance.properties.frontend_ip_configuration.id): - instance.properties.frontend_ip_configuration = None - - -_LBRule = import_aaz_by_profile("network.lb.rule") - - -class LBRuleCreate(_LBRule.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - args_schema.probe_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/probes/{}" - ) - args_schema.backend_address_pool._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/backendAddressPools/{}" - ) - - args_schema.protocol._required = True - args_schema.frontend_port._required = True - args_schema.backend_port._required = True - - return args_schema - - def pre_instance_create(self): - args = self.ctx.args - if not has_value(args.frontend_ip_name): - instance = self.ctx.vars.instance - frontend_ip_configurations = instance.properties.frontend_ip_configurations - if len(frontend_ip_configurations) == 1: - args.frontend_ip_name = instance.properties.frontend_ip_configurations[0].id - elif len(frontend_ip_configurations) > 1: - raise ArgumentUsageError( - "Multiple FrontendIpConfigurations found in loadbalancer. Specify --frontend-ip explicitly.") - if not has_value(args.backend_address_pool): - instance = self.ctx.vars.instance - backend_address_pools = instance.properties.backend_address_pools - if len(backend_address_pools) == 1: - args.backend_address_pool = instance.properties.backend_address_pools[0].id - elif len(backend_address_pools) > 1: - raise ArgumentUsageError( - "Multiple BackendAddressPools found in loadbalancer. Specify --backend-pool-name explicitly.") - - -class LBRuleUpdate(_LBRule.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - args_schema.probe_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/probes/{}" - ) - - args_schema.backend_address_pool._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/backendAddressPools/{}" - ) - - args_schema.protocol._nullable = False - args_schema.frontend_port._nullable = False - args_schema.backend_port._nullable = False - return args_schema - - def post_instance_update(self, instance): - if not has_value(instance.properties.frontend_ip_configuration.id): - instance.properties.frontend_ip_configuration = None - if not has_value(instance.properties.probe.id): - instance.properties.probe = None - if not has_value(instance.properties.backend_address_pool.id): - instance.properties.backend_address_pool = None - - -_LBProbe = import_aaz_by_profile("network.lb.probe") - - -class LBProbeCreate(_LBProbe.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.port._required = True - args_schema.protocol._required = True - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.request_path) and args.request_path == "": - args.request_path = None - - -class LBProbeUpdate(_LBProbe.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.port._nullable = False - args_schema.protocol._nullable = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.request_path) and args.request_path == "": - args.request_path = None diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/locations.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/locations.py deleted file mode 100644 index 4167fb38678..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/locations.py +++ /dev/null @@ -1,22 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from ._util import import_aaz_by_profile - - -_NetWork = import_aaz_by_profile("network") - - -class UsagesList(_NetWork.ListUsages): - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - result = list(result) - for item in result: - item['currentValue'] = str(item['currentValue']) - item['limit'] = str(item['limit']) - item['localName'] = item['name']['localizedValue'] - return result, next_link -# endregion diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/nic.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/nic.py deleted file mode 100644 index bbe8d0b29c1..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/nic.py +++ /dev/null @@ -1,406 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods, unused-argument -from azure.cli.core.aaz import AAZResourceIdArgFormat, has_value, AAZListArg, AAZResourceIdArg, \ - AAZStrArg -from azure.cli.core.aaz.utils import assign_aaz_list_arg -from knack.log import get_logger - -from ._util import import_aaz_by_profile - -logger = get_logger(__name__) - - -_NIC = import_aaz_by_profile("network.nic") - - -class NICCreate(_NIC.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - arg_group="IP Configuration", - help="Name of the virtual network.", - ) - args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="IP Configuration", - help="Name or ID of an existing subnet. If name specified, please also specify `--vnet-name`; " - "If you want to use an existing subnet in other resource group, " - "please provide the ID instead of the name of the subnet.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/virtualNetworks/{vnet_name}/subnets/{}", - ), - ) - args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="IP Configuration", - help="Static private IP address to use.", - ) - args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="IP Configuration", - help="Name or ID of an existing public IP address.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/" - "publicIPAddresses/{}" - ), - ) - args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - arg_group="Application Gateway", - help="Name of the application gateway." - ) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - arg_group="Load Balancer", - help="Name of the load balancer", - ) - args_schema.lb_address_pools = AAZListArg( - options=["--lb-address-pools"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer address pools to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/backendAddressPools/{}", - ), - ) - args_schema.lb_inbound_nat_rules = AAZListArg( - options=["--lb-inbound-nat-rules"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer inbound NAT rules to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_inbound_nat_rules.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ), - ) - args_schema.network_security_group = AAZResourceIdArg( - options=["--network-security-group"], - help="Name or ID of an existing network security group", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ), - ) - args_schema.ip_configurations._registered = False - args_schema.nsg._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.network_security_group): - args.nsg.id = args.network_security_group - ip_configuration = { - "name": "ipconfig1", - "private_ip_address": args.private_ip_address, - "private_ip_allocation_method": "Static" if has_value(args.private_ip_address) else "Dynamic", - "subnet": {"id": args.subnet} if has_value(args.subnet) else None, - "public_ip_address": {"id": args.public_ip_address} if has_value(args.public_ip_address) else None, - "load_balancer_backend_address_pools": [{"id": x} for x in args.lb_address_pools] if has_value(args.lb_address_pools) else None, - "load_balancer_inbound_nat_rules": [{"id": x} for x in args.lb_inbound_nat_rules] if has_value(args.lb_inbound_nat_rules) else None, - } - args.ip_configurations = [ip_configuration] - - def _output(self, *args, **kwargs): - result = super()._output(*args, **kwargs) - return {"NewNIC": result} - - -class NICUpdate(_NIC.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.network_security_group = AAZResourceIdArg( - options=["--network-security-group"], - help="Name or ID of an existing network security group", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ), - nullable=True, - ) - args_schema.nsg._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.network_security_group): - args.nsg.id = args.network_security_group - if has_value(args.internal_dns_name) and args.internal_dns_name == "": - args.internal_dns_name = None - - def post_instance_update(self, instance): - if not has_value(instance.properties.network_security_group.id): - instance.properties.network_security_group = None - - -_NICIPConfig = import_aaz_by_profile("network.nic.ip_config") - - -class NICIPConfigCreate(_NICIPConfig.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - arg_group="IP Configuration", - help="Name of the virtual network.", - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/" - "publicIPAddresses/{}" - ) - args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - arg_group="Application Gateway", - help="Name of the application gateway." - ) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - arg_group="Load Balancer", - help="Name of the load balancer", - ) - args_schema.lb_address_pools = AAZListArg( - options=["--lb-address-pools"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer address pools to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/backendAddressPools/{}", - ), - ) - args_schema.lb_inbound_nat_rules = AAZListArg( - options=["--lb-inbound-nat-rules"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer inbound NAT rules to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_inbound_nat_rules.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ), - ) - args_schema.load_balancer_backend_address_pools._registered = False - args_schema.load_balancer_inbound_nat_rules._registered = False - args_schema.private_ip_allocation_method._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - args.private_ip_allocation_method = "Static" if has_value(args.private_ip_address) else "Dynamic" - - args.load_balancer_backend_address_pools = assign_aaz_list_arg( - args.load_balancer_backend_address_pools, - args.lb_address_pools, - element_transformer=lambda _, pool_id: {"id": pool_id} - ) - args.load_balancer_inbound_nat_rules = assign_aaz_list_arg( - args.load_balancer_inbound_nat_rules, - args.lb_inbound_nat_rules, - element_transformer=lambda _, rule_id: {"id": rule_id} - ) - - def pre_instance_create(self): - args = self.ctx.args - instance = self.ctx.vars.instance - if not has_value(args.subnet): - primary = next(x for x in instance.properties.ip_configurations if x.properties.primary) - args.subnet = primary.properties.subnet.id - if args.make_primary.to_serialized_data(): - for config in instance.properties.ip_configurations: - config.properties.primary = False - - -class NICIPConfigUpdate(_NICIPConfig.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - arg_group="IP Configuration", - help="Name of the virtual network.", - nullable=True, - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/" - "publicIPAddresses/{}" - ) - args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - arg_group="Application Gateway", - help="Name of the application gateway.", - nullable=True, - ) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - arg_group="Load Balancer", - help="Name of the load balancer", - nullable=True, - ) - args_schema.lb_address_pools = AAZListArg( - options=["--lb-address-pools"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer address pools to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - nullable=True, - ) - args_schema.lb_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/backendAddressPools/{}", - ), - nullable=True, - ) - args_schema.lb_inbound_nat_rules = AAZListArg( - options=["--lb-inbound-nat-rules"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer inbound NAT rules to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - nullable=True, - ) - args_schema.lb_inbound_nat_rules.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ), - nullable=True, - ) - args_schema.load_balancer_backend_address_pools._registered = False - args_schema.load_balancer_inbound_nat_rules._registered = False - args_schema.private_ip_allocation_method._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.private_ip_address): - if args.private_ip_address is None or args.private_ip_address == "": - # switch private IP address allocation to dynamic if empty string is used - args.private_ip_address = None - args.private_ip_allocation_method = "Dynamic" - else: - # if specific address provided, allocation is static - args.private_ip_allocation_method = "Static" - - def pre_instance_update(self, instance): - args = self.ctx.args - instance = self.ctx.vars.instance - - args.load_balancer_backend_address_pools = assign_aaz_list_arg( - args.load_balancer_backend_address_pools, - args.lb_address_pools, - element_transformer=lambda _, pool_id: {"id": pool_id} - ) - args.load_balancer_inbound_nat_rules = assign_aaz_list_arg( - args.load_balancer_inbound_nat_rules, - args.lb_inbound_nat_rules, - element_transformer=lambda _, rule_id: {"id": rule_id} - ) - # all ip configurations must belong to the same asgs - is_primary = args.make_primary.to_serialized_data() - for config in instance.properties.ip_configurations: - if is_primary: - config.properties.primary = False - - def post_instance_update(self, instance): - if not has_value(instance.properties.subnet.id): - instance.properties.subnet = None - if not has_value(instance.properties.public_ip_address.id): - instance.properties.public_ip_address = None - - -_LBPool = import_aaz_by_profile("network.nic.ip_config.lb_pool") - - -def add_nic_ip_config_address_pool(cmd, resource_group_name, network_interface_name, ip_config_name, - backend_address_pool, load_balancer_name): - - class LBPoolAdd(_LBPool.Add): - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result["ipConfigurations"][0] - - arguments = { - "ip_config_name": ip_config_name, - "nic_name": network_interface_name, - "resource_group": resource_group_name, - "pool_id": backend_address_pool - } - return LBPoolAdd(cli_ctx=cmd.cli_ctx)(command_args=arguments) - - -def remove_nic_ip_config_address_pool(cmd, resource_group_name, network_interface_name, ip_config_name, - backend_address_pool, load_balancer_name): - LBPoolRemove = _LBPool.Remove - arguments = { - "ip_config_name": ip_config_name, - "nic_name": network_interface_name, - "resource_group": resource_group_name, - "pool_id": backend_address_pool - } - return LBPoolRemove(cli_ctx=cmd.cli_ctx)(command_args=arguments) - - -_NICIPConfigNAT = import_aaz_by_profile("network.nic.ip_config.inbound_nat_rule") - - -class NICIPConfigNATAdd(_NICIPConfigNAT.Add): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="Name of the load balancer", - ) - args_schema.inbound_nat_rule._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ) - return args_schema - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result["ipConfigurations"][0] - - -class NICIPConfigNATRemove(_NICIPConfigNAT.Remove): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="Name of the load balancer", - ) - args_schema.inbound_nat_rule._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ) - return args_schema diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/nsg.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/nsg.py deleted file mode 100644 index 98e145c42ba..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/nsg.py +++ /dev/null @@ -1,40 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger - -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_Nsg = import_aaz_by_profile("network.nsg") -_NsgRule = import_aaz_by_profile("network.nsg.rule") - - -class NSGCreate(_Nsg.Create): - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return {"NewNSG": result} - - -class NSGRuleCreate(_NsgRule.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.priority._required = True - return args_schema - - -def list_nsg_rules(cmd, resource_group_name, network_security_group_name, include_default=False): - Show = import_aaz_by_profile("network.nsg").Show - nsg = Show(cli_ctx=cmd.cli_ctx)(command_args={ - "resource_group": resource_group_name, - "name": network_security_group_name - }) - - rules = nsg["securityRules"] - return rules + nsg["defaultSecurityRules"] if include_default else rules diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/public_ip.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/public_ip.py deleted file mode 100644 index b49b1f377b0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/public_ip.py +++ /dev/null @@ -1,37 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_PublicIP = import_aaz_by_profile("network.public_ip") - - -def create_public_ip(cmd, resource_group_name, public_ip_address_name, location=None, tags=None, - allocation_method=None, dns_name=None, - idle_timeout=4, reverse_fqdn=None, ip_address=None): - public_ip_args = { - 'name': public_ip_address_name, - "resource_group": resource_group_name, - 'location': location, - 'tags': tags, - 'allocation_method': allocation_method, - 'idle_timeout': idle_timeout, - 'ip_address': ip_address, - } - - if not allocation_method: - public_ip_args['allocation_method'] = 'Dynamic' - - if dns_name or reverse_fqdn: - public_ip_args['dns_name'] = dns_name - public_ip_args['reverse_fqdn'] = reverse_fqdn - - PublicIpCreate = import_aaz_by_profile("network.public_ip").Create - return PublicIpCreate(cli_ctx=cmd.cli_ctx)(command_args=public_ip_args) diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/vnet.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/vnet.py deleted file mode 100644 index 332b053d195..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/vnet.py +++ /dev/null @@ -1,109 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger - -from azure.cli.core.aaz import has_value -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_VNet = import_aaz_by_profile("network.vnet") - - -class VNetCreate(_VNet.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZStrArg, AAZResourceIdArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - # add subnet arguments - args_schema.subnet_name = AAZStrArg( - options=["--subnet-name"], - arg_group="Subnet", - help="Name of a new subnet to create within the VNet.", - ) - args_schema.subnet_prefixes = AAZListArg( - options=["--subnet-prefixes"], - arg_group="Subnet", - help="Space-separated list of address prefixes in CIDR format for the new subnet. If omitted, " - "automatically reserves a /24 (or as large as available) block within the VNet address space.", - ) - args_schema.subnet_prefixes.Element = AAZStrArg() - args_schema.subnet_nsg = AAZResourceIdArg( - options=["--nsg", "--network-security-group"], - arg_group="Subnet", - help="Name or ID of a network security group (NSG).", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ), - ) - # filter arguments - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.subnet_name): - subnet = {"name": args.subnet_name} - if not has_value(args.subnet_prefixes): - # set default value - address, bit_mask = str(args.address_prefixes[0]).split("/") - subnet_mask = 24 if int(bit_mask) < 24 else bit_mask - subnet["address_prefix"] = f"{address}/{subnet_mask}" - elif len(args.subnet_prefixes) == 1: - subnet["address_prefix"] = args.subnet_prefixes[0] - else: - subnet["address_prefixes"] = args.subnet_prefixes - if has_value(args.subnet_nsg): - subnet["network_security_group"] = {"id": args.subnet_nsg} - args.subnets = [subnet] - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return {"newVNet": result} - - -_VNetSubNet = import_aaz_by_profile("network.vnet.subnet") - - -class VNetSubnetCreate(_VNetSubNet.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.network_security_group._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ) - args_schema.route_table._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/routeTables/{}", - ) - return args_schema - - -class VNetSubnetUpdate(_VNetSubNet.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - # handle detach logic - args_schema.network_security_group._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ) - args_schema.route_table._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/routeTables/{}", - ) - return args_schema - - def post_instance_update(self, instance): - if not has_value(instance.properties.network_security_group.id): - instance.properties.network_security_group = None - if not has_value(instance.properties.route_table.id): - instance.properties.route_table = None diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/vnet_gateway.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/vnet_gateway.py deleted file mode 100644 index 66099b5b3ba..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/vnet_gateway.py +++ /dev/null @@ -1,208 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from azure.cli.core.aaz import AAZListArg, AAZStrArg, AAZResourceIdArg, AAZResourceIdArgFormat, AAZFileArg, \ - AAZFileArgBase64EncodeFormat, has_value -from knack.log import get_logger - -from ._util import import_aaz_by_profile - -logger = get_logger(__name__) - - -_VnetGateway = import_aaz_by_profile("network.vnet_gateway") - - -class VnetGatewayCreate(_VnetGateway.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.public_ip_addresses = AAZListArg( - options=['--public-ip-addresses', '--public-ip-address'], - required=True, - help="Specify a single public IP (name or ID) for an active-standby gateway. Specify two space-separated public IPs for an active-active gateway." - ) - args_schema.public_ip_addresses.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}" - ) - ) - args_schema.vnet = AAZResourceIdArg( - options=['--vnet'], - help="Name or ID of an existing virtual network which has a subnet named 'GatewaySubnet'.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{}" - ) - ) - - args_schema.root_cert_data = AAZFileArg(options=['--root-cert-data'], arg_group="Root Cert Authentication", - help="Base64 contents of the root certificate file or file path.", - fmt=AAZFileArgBase64EncodeFormat()) - args_schema.root_cert_name = AAZStrArg(options=['--root-cert-name'], arg_group="Root Cert Authentication", - help="Root certificate name.") - args_schema.gateway_default_site._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/localNetworkGateways/{}" - ) - args_schema.ip_configurations._registered = False - args_schema.vpn_client_root_certificates._registered = False - args_schema.sku_tier._registered = False - args_schema.enable_bgp._registered = False - - return args_schema - - def pre_operations(self): - args = self.ctx.args - subnet = args.vnet.to_serialized_data() + '/subnets/GatewaySubnet' - args.sku_tier = args.sku - - args.ip_configurations = [] - if has_value(args.public_ip_addresses): - public_ip_addresses = args.public_ip_addresses.to_serialized_data() - ip_configuration = {} - for i, public_ip in enumerate(public_ip_addresses): - ip_configuration[i] = {'subnet': subnet, 'public_ip_address': public_ip, - 'private_ip_allocation_method': 'Dynamic', - 'name': 'vnetGatewayConfig{}'.format(i)} - args.ip_configurations.append(ip_configuration[i]) - - if has_value(args.asn) or has_value(args.bgp_peering_address) or has_value(args.peer_weight): - args.enable_bgp = True - else: - args.asn = None - args.bgp_peering_address = None - args.peer_weight = None - - if has_value(args.address_prefixes): - import os - if has_value(args.root_cert_data): - path = os.path.expanduser(args.root_cert_data.to_serialized_data()) - else: - path = None - if has_value(args.root_cert_name): - args.vpn_client_root_certificates = [{'name': args.root_cert_name, 'public_cert_data': path}] - else: - args.vpn_client_root_certificates = [] - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return {'vnetGateway': result} - - -class VnetGatewayUpdate(_VnetGateway.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.public_ip_addresses = AAZListArg( - options=['--public-ip-addresses', '--public-ip-address'], - help="Specify a single public IP (name or ID) for an active-standby gateway. Specify two space-separated public IPs for an active-active gateway." - ) - args_schema.public_ip_addresses.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}" - ), - nullable=True, - ) - args_schema.vnet = AAZResourceIdArg( - options=['--vnet'], - help="Name or ID of an existing virtual network which has a subnet named 'GatewaySubnet'.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{}" - ), - ) - args_schema.root_cert_data = AAZFileArg(options=['--root-cert-data'], arg_group="Root Cert Authentication", - help="Base64 contents of the root certificate file or file path.", - fmt=AAZFileArgBase64EncodeFormat(), nullable=True) - args_schema.root_cert_name = AAZStrArg(options=['--root-cert-name'], arg_group="Root Cert Authentication", - help="Root certificate name.", nullable=True,) - args_schema.gateway_default_site._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/localNetworkGateways/{}" - ) - args_schema.ip_configurations._registered = False - args_schema.vpn_client_root_certificates._registered = False - args_schema.sku_tier._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.root_cert_data): - import os - path = os.path.expanduser(args.root_cert_data.to_serialized_data()) - args.root_cert_data = path - - if has_value(args.sku): - args.sku_tier = args.sku - - def pre_instance_update(self, instance): - args = self.ctx.args - if has_value(args.root_cert_data): - collection = instance.properties.vpn_client_configuration.vpn_client_root_certificates.to_serialized_data() - root_certificate = {'name': args.root_cert_name, 'public_cert_data': args.root_cert_data} - value = args.root_cert_name.to_serialized_data() - match = next((x for x in collection if getattr(x, 'name', None) == value), None) - if match: - collection.remove(match) - collection.append(root_certificate) - args.vpn_client_root_certificates = collection - - subnet_id = '{}/subnets/GatewaySubnet'.format(args.vnet) if has_value(args.vnet) else \ - instance.properties.ip_configurations[0].properties.subnet.id - - if has_value(args.vnet): - if has_value(instance.properties.ip_configurations): - for config in instance.properties.ip_configurations: - config.properties.subnet.id = subnet_id - - if has_value(args.public_ip_addresses): - instance.properties.ip_configurations = [] - public_ip_addresses = args.public_ip_addresses.to_serialized_data() - args.ip_configurations = [] - ip_configuration = {} - for i, public_ip in enumerate(public_ip_addresses): - ip_configuration[i] = {'subnet': subnet_id, 'public_ip_address': {'id': public_ip}, - 'private_ip_allocation_method': 'Dynamic', - 'name': 'vnetGatewayConfig{}'.format(i)} - args.ip_configurations.append(ip_configuration[i]) - - -_RevokedCert = import_aaz_by_profile("network.vnet_gateway.revoked_cert") - - -class VnetGatewayRevokedCertCreate(_RevokedCert.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.thumbprint._required = True - - return args_schema - - -_RootCert = import_aaz_by_profile("network.vnet_gateway.root_cert") - - -class VnetGatewayRootCertCreate(_RootCert.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.public_cert_data = AAZFileArg(options=['--public-cert-data'], - help="Base64 contents of the root certificate file or file path.", - required=True, - fmt=AAZFileArgBase64EncodeFormat()) - args_schema.root_cert_data._required = False - args_schema.root_cert_data._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.public_cert_data): - import os - path = os.path.expanduser(args.public_cert_data.to_serialized_data()) - else: - path = None - args.root_cert_data = path diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/vpn_connection.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/vpn_connection.py deleted file mode 100644 index 62b10713a98..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2017_03_09_profile/operations/vpn_connection.py +++ /dev/null @@ -1,22 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger - -from ._util import import_aaz_by_profile - -logger = get_logger(__name__) - - -_VpnConnSharedKey = import_aaz_by_profile("network.vpn_connection.shared_key") - - -class VpnConnSharedKeyUpdate(_VpnConnSharedKey.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.value._required = True - return args_schema diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/__init__.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/__init__.py deleted file mode 100644 index 34913fb394d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/_params.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/_params.py deleted file mode 100644 index 749b974106c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/_params.py +++ /dev/null @@ -1,9 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -# pylint: disable=unused-argument, too-many-locals, too-many-branches, too-many-statements -def load_arguments(self, _): - pass diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/commands.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/commands.py deleted file mode 100644 index dee5260df83..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/commands.py +++ /dev/null @@ -1,169 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -# pylint: disable=too-many-locals, too-many-statements, disable=line-too-long -def load_command_table(self, _): - from .operations import import_aaz_by_profile - - # region LoadBalancers - from .operations.load_balancer import LBFrontendIPCreate, LBFrontendIPUpdate - self.command_table["network lb frontend-ip create"] = LBFrontendIPCreate(loader=self) - self.command_table["network lb frontend-ip update"] = LBFrontendIPUpdate(loader=self) - - from .operations.load_balancer import LBInboundNatRuleCreate, LBInboundNatRuleUpdate - self.command_table["network lb inbound-nat-rule create"] = LBInboundNatRuleCreate(loader=self) - self.command_table["network lb inbound-nat-rule update"] = LBInboundNatRuleUpdate(loader=self) - - from .operations.load_balancer import LBInboundNatPoolCreate, LBInboundNatPoolUpdate - self.command_table["network lb inbound-nat-pool create"] = LBInboundNatPoolCreate(loader=self) - self.command_table["network lb inbound-nat-pool update"] = LBInboundNatPoolUpdate(loader=self) - - from .operations.load_balancer import LBRuleCreate, LBRuleUpdate - self.command_table["network lb rule create"] = LBRuleCreate(loader=self) - self.command_table["network lb rule update"] = LBRuleUpdate(loader=self) - - from .operations.load_balancer import LBProbeCreate, LBProbeUpdate - self.command_table["network lb probe create"] = LBProbeCreate(loader=self) - self.command_table["network lb probe update"] = LBProbeUpdate(loader=self) - - # endregion - - # region LocalNetworkGateways - local_gateway = import_aaz_by_profile("network.local_gateway") - - from .._format import transform_local_gateway_table_output - self.command_table['network local-gateway list'] = local_gateway.List( - loader=self, table_transformer=transform_local_gateway_table_output) - - # endregion - - # region NetworkInterfaces - from .._format import transform_effective_nsg, transform_effective_route_table - operations_tmpl = self.get_module_name_by_profile("operations.nic#{}") - nic = import_aaz_by_profile("network.nic") - - from .operations.nic import NICCreate, NICUpdate - self.command_table["network nic create"] = NICCreate(loader=self) - self.command_table["network nic update"] = NICUpdate(loader=self) - self.command_table["network nic list-effective-nsg"] = nic.ListEffectiveNsg(loader=self, table_transformer=transform_effective_nsg) - self.command_table["network nic show-effective-route-table"] = nic.ShowEffectiveRouteTable(loader=self, table_transformer=transform_effective_route_table) - - from .operations.nic import NICIPConfigCreate, NICIPConfigUpdate, NICIPConfigNATAdd, NICIPConfigNATRemove - self.command_table["network nic ip-config create"] = NICIPConfigCreate(loader=self) - self.command_table["network nic ip-config update"] = NICIPConfigUpdate(loader=self) - self.command_table["network nic ip-config inbound-nat-rule add"] = NICIPConfigNATAdd(loader=self) - self.command_table["network nic ip-config inbound-nat-rule remove"] = NICIPConfigNATRemove(loader=self) - - with self.command_group("network nic ip-config address-pool", operations_tmpl=operations_tmpl) as g: - g.custom_command("add", "add_nic_ip_config_address_pool") - g.custom_command("remove", "remove_nic_ip_config_address_pool") - - # endregion - - # region VirtualNetworkGatewayConnections - from .operations.vpn_connection import VpnConnectionUpdate, VpnConnectionDeviceConfigScriptShow - self.command_table['network vpn-connection update'] = VpnConnectionUpdate(loader=self) - self.command_table['network vpn-connection show-device-config-script'] = VpnConnectionDeviceConfigScriptShow( - loader=self) - - from .operations.vpn_connection import VpnConnSharedKeyUpdate - self.command_table['network vpn-connection shared-key update'] = VpnConnSharedKeyUpdate(loader=self) - - from .operations.vpn_connection import VpnConnIpsecPolicyAdd - self.command_table['network vpn-connection ipsec-policy add'] = VpnConnIpsecPolicyAdd(loader=self) - - operations_tmpl = self.get_module_name_by_profile("operations.vpn_connection#{}") - with self.command_group('network vpn-connection', operations_tmpl=operations_tmpl) as g: - g.command('list', 'list_vpn_connections') - g.command('ipsec-policy clear', 'clear_vpn_conn_ipsec_policies', supports_no_wait=True) - - # endregion - - # region VirtualNetworkGateways - from .._format import transform_vnet_gateway_bgp_peer_table, transform_vnet_gateway_routes_table - operations_tmpl = self.get_module_name_by_profile("operations.vnet_gateway#{}") - vnet_gateway = import_aaz_by_profile("network.vnet_gateway") - - self.command_table['network vnet-gateway list-bgp-peer-status'] = vnet_gateway.ListBgpPeerStatus( - loader=self, table_transformer=transform_vnet_gateway_bgp_peer_table) - self.command_table['network vnet-gateway list-advertised-routes'] = vnet_gateway.ListAdvertisedRoutes( - loader=self, table_transformer=transform_vnet_gateway_routes_table) - self.command_table['network vnet-gateway list-learned-routes'] = vnet_gateway.ListLearnedRoutes( - loader=self, table_transformer=transform_vnet_gateway_routes_table) - - from .operations.vnet_gateway import VnetGatewayCreate, VnetGatewayUpdate - self.command_table['network vnet-gateway create'] = VnetGatewayCreate(loader=self) - self.command_table['network vnet-gateway update'] = VnetGatewayUpdate(loader=self) - - with self.command_group('network vnet-gateway vpn-client', operations_tmpl=operations_tmpl) as g: - g.command('generate', 'generate_vpn_client') - - from .operations.vnet_gateway import VnetGatewayRevokedCertCreate - self.command_table['network vnet-gateway revoked-cert create'] = VnetGatewayRevokedCertCreate(loader=self) - - from .operations.vnet_gateway import VnetGatewayRootCertCreate - self.command_table['network vnet-gateway root-cert create'] = VnetGatewayRootCertCreate(loader=self) - - # region VirtualNetwork - from .operations.vnet import VNetCreate, VNetSubnetCreate, VNetSubnetUpdate, VNetPeeringCreate - from .._format import transform_vnet_table_output - vnet = import_aaz_by_profile("network.vnet") - operations_tmpl = self.get_module_name_by_profile("operations.vnet#{}") - self.command_table['network vnet create'] = VNetCreate(loader=self) - self.command_table['network vnet list'] = vnet.List(loader=self, table_transformer=transform_vnet_table_output) - with self.command_group('network vnet', operations_tmpl=operations_tmpl) as g: - g.custom_command("list-available-ips", "list_available_ips", is_preview=True) - - self.command_table['network vnet peering create'] = VNetPeeringCreate(loader=self) - with self.command_group('network vnet peering', operations_tmpl=operations_tmpl) as g: - g.custom_command("sync", "sync_vnet_peering") - - self.command_table['network vnet subnet create'] = VNetSubnetCreate(loader=self) - self.command_table['network vnet subnet update'] = VNetSubnetUpdate(loader=self) - with self.command_group('network vnet subnet', operations_tmpl=operations_tmpl) as g: - g.custom_command("list-available-ips", "subnet_list_available_ips", is_preview=True) - - # endregion - - # region NetworkRoot - with self.command_group('network'): - from .operations.locations import UsagesList - from .._format import transform_network_usage_table - self.command_table['network list-usages'] = UsagesList(loader=self, - table_transformer=transform_network_usage_table) - # endregion - - # region PublicIPAddresses - public_ip_show_table_transform = '{Name:name, ResourceGroup:resourceGroup, Location:location, $zone$Address:ipAddress, AddressVersion:publicIpAddressVersion, AllocationMethod:publicIpAllocationMethod, IdleTimeoutInMinutes:idleTimeoutInMinutes, ProvisioningState:provisioningState}' - public_ip_show_table_transform = public_ip_show_table_transform.replace('$zone$', 'Zones: (!zones && \' \') || join(` `, zones), ') - - public_ip = import_aaz_by_profile("network.public_ip") - operations_tmpl = self.get_module_name_by_profile("operations.public_ip#{}") - from .._format import transform_public_ip_create_output - from .._validators import process_public_ip_create_namespace - - with self.command_group('network public-ip', operations_tmpl=operations_tmpl) as g: - g.custom_command("create", "create_public_ip", transform=transform_public_ip_create_output, validator=process_public_ip_create_namespace) - - self.command_table['network public-ip list'] = public_ip.List(loader=self, table_transformer='[].' + public_ip_show_table_transform) - self.command_table['network public-ip show'] = public_ip.Show(loader=self, table_transformer=public_ip_show_table_transform) - - # endregion - - # region NetworkSecurityGroups - from .operations.nsg import NSGCreate, NSGRuleCreate, NSGRuleUpdate - from .._format import transform_nsg_rule_table_output - operations_tmpl = self.get_module_name_by_profile("operations.nsg#{}") - nsgRule = import_aaz_by_profile("network.nsg.rule") - self.command_table["network nsg create"] = NSGCreate(loader=self) - - self.command_table["network nsg rule create"] = NSGRuleCreate(loader=self) - self.command_table["network nsg rule update"] = NSGRuleUpdate(loader=self) - - self.command_table["network nsg rule show"] = nsgRule.Show(loader=self, table_transformer=transform_nsg_rule_table_output) - with self.command_group("network nsg rule", operations_tmpl=operations_tmpl) as g: - g.custom_command("list", "list_nsg_rules", table_transformer=lambda x: [transform_nsg_rule_table_output(i) for i in x]) - # endregion diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/__init__.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/__init__.py deleted file mode 100644 index fca9bdf191e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-import -from ._util import import_aaz_by_profile diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/_util.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/_util.py deleted file mode 100644 index 45a7de19ace..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/_util.py +++ /dev/null @@ -1,9 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -import importlib - - -def import_aaz_by_profile(module_name): - return importlib.import_module(f"azure.cli.command_modules.network.aaz.profile_2018_03_01_hybrid.{module_name}") diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/load_balancer.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/load_balancer.py deleted file mode 100644 index a5f5b6c3e51..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/load_balancer.py +++ /dev/null @@ -1,306 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger -from azure.cli.core.azclierror import ArgumentUsageError -from azure.cli.core.aaz import AAZResourceIdArgFormat, has_value, AAZStrArg, AAZArgEnum -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_LBFrontendIP = import_aaz_by_profile("network.lb.frontend_ip") - - -class LBFrontendIPCreate(_LBFrontendIP.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - arg_group="Properties", - options=['--vnet-name'], - help="The virtual network (VNet) associated with the subnet (Omit if supplying a subnet id)." - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}", - ) - - args_schema.zones.Element.enum = AAZArgEnum({ - "1": "1", - "2": "2", - "3": "3", - }) - args_schema.private_ip_allocation_method._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.subnet) and has_value(args.public_ip_address): - raise ArgumentUsageError( - 'incorrect usage: --subnet NAME --vnet-name NAME | ' - '--subnet ID | --public-ip-address NAME_OR_ID') - - if not has_value(args.public_ip_address): - logger.warning( - "Please note that the default public IP used for LB frontend will be changed from Basic to Standard " - "in the future." - ) - - if has_value(args.private_ip_address): - args.private_ip_allocation_method = 'Static' - else: - args.private_ip_allocation_method = 'Dynamic' - - -class LBFrontendIPUpdate(_LBFrontendIP.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - arg_group="Properties", - options=['--vnet-name'], - help="The virtual network (VNet) associated with the subnet (Omit if supplying a subnet id)." - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}", - ) - - args_schema.zones.Element.enum = AAZArgEnum({ - "1": "1", - "2": "2", - "3": "3", - }) - args_schema.private_ip_allocation_method._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.private_ip_address): - # update private_ip_address - if args.private_ip_address: - args.private_ip_allocation_method = 'Static' - else: - # set private_ip_address as null value - args.private_ip_allocation_method = 'Dynamic' - - def post_instance_update(self, instance): - if not has_value(instance.properties.subnet.id): - instance.properties.subnet = None - if not has_value(instance.properties.public_ip_address.id): - instance.properties.public_ip_address = None - - -_LBInboundNatPool = import_aaz_by_profile("network.lb.inbound_nat_pool") - - -class LBInboundNatPoolCreate(_LBInboundNatPool.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - - args_schema.protocol._required = True - args_schema.backend_port._required = True - args_schema.frontend_port_range_start._required = True - args_schema.frontend_port_range_end._required = True - return args_schema - - def pre_instance_create(self): - args = self.ctx.args - if not has_value(args.frontend_ip_name): - instance = self.ctx.vars.instance - frontend_ip_configurations = instance.properties.frontend_ip_configurations - if len(frontend_ip_configurations) == 1: - args.frontend_ip_name = instance.properties.frontend_ip_configurations[0].id - elif len(frontend_ip_configurations) > 1: - raise ArgumentUsageError("Multiple FrontendIpConfigurations found in loadbalancer. Specify --frontend-ip explicitly.") - - -class LBInboundNatPoolUpdate(_LBInboundNatPool.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - - args_schema.protocol._nullable = False - args_schema.backend_port._nullable = False - args_schema.frontend_port_range_start._nullable = False - args_schema.frontend_port_range_end._nullable = False - return args_schema - - def post_instance_update(self, instance): - if not has_value(instance.properties.frontend_ip_configuration.id): - instance.properties.frontend_ip_configuration = None - - -_LBInboundNatRule = import_aaz_by_profile("network.lb.inbound_nat_rule") - - -class LBInboundNatRuleCreate(_LBInboundNatRule.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - - # required for a public load balancer - args_schema.protocol._required = True - args_schema.backend_port._required = True - return args_schema - - def pre_instance_create(self): - args = self.ctx.args - if not has_value(args.frontend_ip_name): - instance = self.ctx.vars.instance - frontend_ip_configurations = instance.properties.frontend_ip_configurations - if len(frontend_ip_configurations) == 1: - args.frontend_ip_name = instance.properties.frontend_ip_configurations[0].id - elif len(frontend_ip_configurations) > 1: - raise ArgumentUsageError("Multiple FrontendIpConfigurations found in loadbalancer. Specify --frontend-ip explicitly.") - - -class LBInboundNatRuleUpdate(_LBInboundNatRule.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - return args_schema - - def post_instance_update(self, instance): - if not has_value(instance.properties.frontend_ip_configuration.id): - instance.properties.frontend_ip_configuration = None - - -_LBRule = import_aaz_by_profile("network.lb.rule") - - -class LBRuleCreate(_LBRule.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - args_schema.probe_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/probes/{}" - ) - args_schema.backend_address_pool._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/backendAddressPools/{}" - ) - - args_schema.protocol._required = True - args_schema.frontend_port._required = True - args_schema.backend_port._required = True - - return args_schema - - def pre_instance_create(self): - args = self.ctx.args - if not has_value(args.frontend_ip_name): - instance = self.ctx.vars.instance - frontend_ip_configurations = instance.properties.frontend_ip_configurations - if len(frontend_ip_configurations) == 1: - args.frontend_ip_name = instance.properties.frontend_ip_configurations[0].id - elif len(frontend_ip_configurations) > 1: - raise ArgumentUsageError( - "Multiple FrontendIpConfigurations found in loadbalancer. Specify --frontend-ip explicitly.") - if not has_value(args.backend_address_pool): - instance = self.ctx.vars.instance - backend_address_pools = instance.properties.backend_address_pools - if len(backend_address_pools) == 1: - args.backend_address_pool = instance.properties.backend_address_pools[0].id - elif len(backend_address_pools) > 1: - raise ArgumentUsageError( - "Multiple BackendAddressPools found in loadbalancer. Specify --backend-pool-name explicitly.") - - -class LBRuleUpdate(_LBRule.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - args_schema.probe_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/probes/{}" - ) - - args_schema.backend_address_pool._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/backendAddressPools/{}" - ) - - args_schema.protocol._nullable = False - args_schema.frontend_port._nullable = False - args_schema.backend_port._nullable = False - return args_schema - - def post_instance_update(self, instance): - if not has_value(instance.properties.frontend_ip_configuration.id): - instance.properties.frontend_ip_configuration = None - if not has_value(instance.properties.probe.id): - instance.properties.probe = None - if not has_value(instance.properties.backend_address_pool.id): - instance.properties.backend_address_pool = None - - -_LBProbe = import_aaz_by_profile("network.lb.probe") - - -class LBProbeCreate(_LBProbe.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.port._required = True - args_schema.protocol._required = True - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.request_path) and args.request_path == "": - args.request_path = None - - -class LBProbeUpdate(_LBProbe.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.port._nullable = False - args_schema.protocol._nullable = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.request_path) and args.request_path == "": - args.request_path = None diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/locations.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/locations.py deleted file mode 100644 index 4167fb38678..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/locations.py +++ /dev/null @@ -1,22 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from ._util import import_aaz_by_profile - - -_NetWork = import_aaz_by_profile("network") - - -class UsagesList(_NetWork.ListUsages): - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - result = list(result) - for item in result: - item['currentValue'] = str(item['currentValue']) - item['limit'] = str(item['limit']) - item['localName'] = item['name']['localizedValue'] - return result, next_link -# endregion diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/nic.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/nic.py deleted file mode 100644 index 226bd8ddf73..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/nic.py +++ /dev/null @@ -1,528 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods, unused-argument -from azure.cli.core.aaz import AAZResourceIdArgFormat, has_value, AAZListArg, AAZResourceIdArg, \ - AAZStrArg -from azure.cli.core.aaz.utils import assign_aaz_list_arg -from knack.log import get_logger - -from ._util import import_aaz_by_profile - -logger = get_logger(__name__) - - -_NIC = import_aaz_by_profile("network.nic") - - -class NICCreate(_NIC.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - arg_group="IP Configuration", - help="Name of the virtual network.", - ) - args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="IP Configuration", - help="Name or ID of an existing subnet. If name specified, please also specify `--vnet-name`; " - "If you want to use an existing subnet in other resource group, " - "please provide the ID instead of the name of the subnet.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/virtualNetworks/{vnet_name}/subnets/{}", - ), - ) - args_schema.application_security_groups = AAZListArg( - options=["--application-security-groups", "--asgs"], - arg_group="IP Configuration", - help="Space-separated list of application security groups.", - ) - args_schema.application_security_groups.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="IP Configuration", - help="Static private IP address to use.", - ) - args_schema.private_ip_address_version = AAZStrArg( - options=["--private-ip-address-version"], - arg_group="IP Configuration", - help="Version of private IP address to use.", - enum=["IPv4", "IPv6"], - default="IPv4", - ) - args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="IP Configuration", - help="Name or ID of an existing public IP address.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/" - "publicIPAddresses/{}" - ), - ) - args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - arg_group="Application Gateway", - help="Name of the application gateway." - ) - args_schema.app_gateway_address_pools = AAZListArg( - options=["--app-gateway-address-pools", "--ag-address-pools"], - arg_group="Application Gateway", - help="Space-separated list of names or IDs of application gateway backend address pools to " - "associate with the NIC. If names are used, `--gateway-name` must be specified.", - ) - args_schema.app_gateway_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationGateways/{gateway_name}/backendAddressPools/{}", - ), - ) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - arg_group="Load Balancer", - help="Name of the load balancer", - ) - args_schema.lb_address_pools = AAZListArg( - options=["--lb-address-pools"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer address pools to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/backendAddressPools/{}", - ), - ) - args_schema.lb_inbound_nat_rules = AAZListArg( - options=["--lb-inbound-nat-rules"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer inbound NAT rules to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_inbound_nat_rules.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ), - ) - args_schema.network_security_group = AAZResourceIdArg( - options=["--network-security-group"], - help="Name or ID of an existing network security group", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ), - ) - args_schema.ip_configurations._registered = False - args_schema.nsg._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.network_security_group): - args.nsg.id = args.network_security_group - ip_configuration = { - "name": "ipconfig1", - "private_ip_address": args.private_ip_address, - "private_ip_address_version": args.private_ip_address_version, # when address doesn't exist, version should be ipv4 (default) - "private_ip_allocation_method": "Static" if has_value(args.private_ip_address) else "Dynamic", - "subnet": {"id": args.subnet} if has_value(args.subnet) else None, - "public_ip_address": {"id": args.public_ip_address} if has_value(args.public_ip_address) else None, - "application_security_groups": [{"id": x} for x in args.application_security_groups] if has_value(args.application_security_groups) else None, - "application_gateway_backend_address_pools": [{"id": x} for x in args.app_gateway_address_pools] if has_value(args.app_gateway_address_pools) else None, - "load_balancer_backend_address_pools": [{"id": x} for x in args.lb_address_pools] if has_value(args.lb_address_pools) else None, - "load_balancer_inbound_nat_rules": [{"id": x} for x in args.lb_inbound_nat_rules] if has_value(args.lb_inbound_nat_rules) else None, - } - args.ip_configurations = [ip_configuration] - - def _output(self, *args, **kwargs): - result = super()._output(*args, **kwargs) - return {"NewNIC": result} - - -class NICUpdate(_NIC.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.network_security_group = AAZResourceIdArg( - options=["--network-security-group"], - help="Name or ID of an existing network security group", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ), - nullable=True, - ) - args_schema.nsg._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.network_security_group): - args.nsg.id = args.network_security_group - if has_value(args.internal_dns_name) and args.internal_dns_name == "": - args.internal_dns_name = None - - def post_instance_update(self, instance): - if not has_value(instance.properties.network_security_group.id): - instance.properties.network_security_group = None - - -_NICIPConfig = import_aaz_by_profile("network.nic.ip_config") - - -class NICIPConfigCreate(_NICIPConfig.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - arg_group="IP Configuration", - help="Name of the virtual network.", - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/" - "publicIPAddresses/{}" - ) - args_schema.application_security_groups = AAZListArg( - options=["--application-security-groups", "--asgs"], - arg_group="IP Configuration", - help="Space-separated list of application security groups.", - ) - args_schema.application_security_groups.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - arg_group="Application Gateway", - help="Name of the application gateway." - ) - args_schema.app_gateway_address_pools = AAZListArg( - options=["--app-gateway-address-pools", "--ag-address-pools"], - arg_group="Application Gateway", - help="Space-separated list of names or IDs of application gateway backend address pools to " - "associate with the NIC. If names are used, `--gateway-name` must be specified.", - ) - args_schema.app_gateway_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationGateways/{gateway_name}/backendAddressPools/{}", - ), - ) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - arg_group="Load Balancer", - help="Name of the load balancer", - ) - args_schema.lb_address_pools = AAZListArg( - options=["--lb-address-pools"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer address pools to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/backendAddressPools/{}", - ), - ) - args_schema.lb_inbound_nat_rules = AAZListArg( - options=["--lb-inbound-nat-rules"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer inbound NAT rules to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_inbound_nat_rules.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ), - ) - args_schema.application_gateway_backend_address_pools._registered = False - args_schema.load_balancer_backend_address_pools._registered = False - args_schema.load_balancer_inbound_nat_rules._registered = False - args_schema.private_ip_allocation_method._registered = False - args_schema.asgs_obj._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - args.private_ip_allocation_method = "Static" if has_value(args.private_ip_address) else "Dynamic" - - args.asgs_obj = assign_aaz_list_arg( - args.asgs_obj, - args.application_security_groups, - element_transformer=lambda _, asg_id: {"id": asg_id} - ) - args.application_gateway_backend_address_pools = assign_aaz_list_arg( - args.application_gateway_backend_address_pools, - args.app_gateway_address_pools, - element_transformer=lambda _, pool_id: {"id": pool_id} - ) - args.load_balancer_backend_address_pools = assign_aaz_list_arg( - args.load_balancer_backend_address_pools, - args.lb_address_pools, - element_transformer=lambda _, pool_id: {"id": pool_id} - ) - args.load_balancer_inbound_nat_rules = assign_aaz_list_arg( - args.load_balancer_inbound_nat_rules, - args.lb_inbound_nat_rules, - element_transformer=lambda _, rule_id: {"id": rule_id} - ) - - def pre_instance_create(self): - args = self.ctx.args - instance = self.ctx.vars.instance - if args.private_ip_address_version.to_serialized_data().lower() == "ipv4" and not has_value(args.subnet): - primary = next(x for x in instance.properties.ip_configurations if x.properties.primary) - args.subnet = primary.properties.subnet.id - if args.make_primary.to_serialized_data(): - for config in instance.properties.ip_configurations: - config.properties.primary = False - - -class NICIPConfigUpdate(_NICIPConfig.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - arg_group="IP Configuration", - help="Name of the virtual network.", - nullable=True, - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/" - "publicIPAddresses/{}" - ) - args_schema.application_security_groups = AAZListArg( - options=["--application-security-groups", "--asgs"], - arg_group="IP Configuration", - help="Space-separated list of application security groups.", - nullable=True, - ) - args_schema.application_security_groups.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - nullable=True, - ) - args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - arg_group="Application Gateway", - help="Name of the application gateway.", - nullable=True, - ) - args_schema.app_gateway_address_pools = AAZListArg( - options=["--app-gateway-address-pools", "--ag-address-pools"], - arg_group="Application Gateway", - help="Space-separated list of names or IDs of application gateway backend address pools to " - "associate with the NIC. If names are used, `--gateway-name` must be specified.", - nullable=True, - ) - args_schema.app_gateway_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationGateways/{gateway_name}/backendAddressPools/{}", - ), - nullable=True, - ) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - arg_group="Load Balancer", - help="Name of the load balancer", - nullable=True, - ) - args_schema.lb_address_pools = AAZListArg( - options=["--lb-address-pools"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer address pools to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - nullable=True, - ) - args_schema.lb_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/backendAddressPools/{}", - ), - nullable=True, - ) - args_schema.lb_inbound_nat_rules = AAZListArg( - options=["--lb-inbound-nat-rules"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer inbound NAT rules to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - nullable=True, - ) - args_schema.lb_inbound_nat_rules.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ), - nullable=True, - ) - args_schema.application_gateway_backend_address_pools._registered = False - args_schema.load_balancer_backend_address_pools._registered = False - args_schema.load_balancer_inbound_nat_rules._registered = False - args_schema.private_ip_allocation_method._registered = False - args_schema.asgs_obj._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.private_ip_address): - if args.private_ip_address is None or args.private_ip_address == "": - # switch private IP address allocation to dynamic if empty string is used - args.private_ip_address = None - args.private_ip_allocation_method = "Dynamic" - args.private_ip_address_version = "IPv4" - else: - # if specific address provided, allocation is static - args.private_ip_allocation_method = "Static" - - def pre_instance_update(self, instance): - args = self.ctx.args - instance = self.ctx.vars.instance - args.asgs_obj = assign_aaz_list_arg( - args.asgs_obj, - args.application_security_groups, - element_transformer=lambda _, asg_id: {"id": asg_id} - ) - args.application_gateway_backend_address_pools = assign_aaz_list_arg( - args.application_gateway_backend_address_pools, - args.app_gateway_address_pools, - element_transformer=lambda _, pool_id: {"id": pool_id} - ) - args.load_balancer_backend_address_pools = assign_aaz_list_arg( - args.load_balancer_backend_address_pools, - args.lb_address_pools, - element_transformer=lambda _, pool_id: {"id": pool_id} - ) - args.load_balancer_inbound_nat_rules = assign_aaz_list_arg( - args.load_balancer_inbound_nat_rules, - args.lb_inbound_nat_rules, - element_transformer=lambda _, rule_id: {"id": rule_id} - ) - # all ip configurations must belong to the same asgs - is_primary = args.make_primary.to_serialized_data() - for config in instance.properties.ip_configurations: - if is_primary: - config.properties.primary = False - config.properties.application_security_groups = args.asgs_obj - - def post_instance_update(self, instance): - if not has_value(instance.properties.subnet.id): - instance.properties.subnet = None - if not has_value(instance.properties.public_ip_address.id): - instance.properties.public_ip_address = None - - -_LBPool = import_aaz_by_profile("network.nic.ip_config.lb_pool") - -_AGPool = import_aaz_by_profile("network.nic.ip_config.ag_pool") - - -def add_nic_ip_config_address_pool(cmd, resource_group_name, network_interface_name, ip_config_name, - backend_address_pool, load_balancer_name=None, application_gateway_name=None): - - class LBPoolAdd(_LBPool.Add): - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result["ipConfigurations"][0] - - class AGPoolAdd(_AGPool.Add): - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result["ipConfigurations"][0] - - arguments = { - "ip_config_name": ip_config_name, - "nic_name": network_interface_name, - "resource_group": resource_group_name, - "pool_id": backend_address_pool - } - if load_balancer_name: - return LBPoolAdd(cli_ctx=cmd.cli_ctx)(command_args=arguments) - if application_gateway_name: - return AGPoolAdd(cli_ctx=cmd.cli_ctx)(command_args=arguments) - - -def remove_nic_ip_config_address_pool(cmd, resource_group_name, network_interface_name, ip_config_name, - backend_address_pool, load_balancer_name=None, application_gateway_name=None): - LBPoolRemove = _LBPool.Remove - AGPoolRemove = _AGPool.Remove - arguments = { - "ip_config_name": ip_config_name, - "nic_name": network_interface_name, - "resource_group": resource_group_name, - "pool_id": backend_address_pool - } - if load_balancer_name: - return LBPoolRemove(cli_ctx=cmd.cli_ctx)(command_args=arguments) - if application_gateway_name: - return AGPoolRemove(cli_ctx=cmd.cli_ctx)(command_args=arguments) - - -_NICIPConfigNAT = import_aaz_by_profile("network.nic.ip_config.inbound_nat_rule") - - -class NICIPConfigNATAdd(_NICIPConfigNAT.Add): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="Name of the load balancer", - ) - args_schema.inbound_nat_rule._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ) - return args_schema - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result["ipConfigurations"][0] - - -class NICIPConfigNATRemove(_NICIPConfigNAT.Remove): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="Name of the load balancer", - ) - args_schema.inbound_nat_rule._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ) - return args_schema diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/nsg.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/nsg.py deleted file mode 100644 index 76188d98d46..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/nsg.py +++ /dev/null @@ -1,184 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger - -from azure.cli.core.aaz import has_value -from azure.cli.core.aaz.utils import assign_aaz_list_arg -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_Nsg = import_aaz_by_profile("network.nsg") -_NsgRule = import_aaz_by_profile("network.nsg.rule") - - -class NSGCreate(_Nsg.Create): - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return {"NewNSG": result} - - -def _handle_plural_or_singular(args, plural_name, singular_name): - values = getattr(args, plural_name) - if not has_value(values): - return - - setattr(args, plural_name, values if len(values) > 1 else None) - setattr(args, singular_name, values[0] if len(values) == 1 else None) - - -class NSGRuleCreate(_NsgRule.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZResourceIdArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.priority._required = True - args_schema.destination_asgs = AAZListArg( - options=["--destination-asgs"], - arg_group="Destination", - help="Space-separated list of application security group names or IDs. Limited by backend server, " - "temporarily this argument only supports one application security group name or ID.", - ) - args_schema.destination_asgs.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - args_schema.source_asgs = AAZListArg( - options=["--source-asgs"], - arg_group="Source", - help="Space-separated list of application security group names or IDs. Limited by backend server, " - "temporarily this argument only supports one application security group name or ID.", - ) - args_schema.source_asgs.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - # filter arguments - args_schema.destination_address_prefix._registered = False - args_schema.destination_application_security_groups._registered = False - args_schema.destination_port_range._registered = False - args_schema.source_address_prefix._registered = False - args_schema.source_application_security_groups._registered = False - args_schema.source_port_range._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - _handle_plural_or_singular(args, "destination_address_prefixes", "destination_address_prefix") - _handle_plural_or_singular(args, "destination_port_ranges", "destination_port_range") - _handle_plural_or_singular(args, "source_address_prefixes", "source_address_prefix") - _handle_plural_or_singular(args, "source_port_ranges", "source_port_range") - # handle application security groups - if has_value(args.destination_asgs): - args.destination_application_security_groups = [{"id": asg_id} for asg_id in args.destination_asgs] - if has_value(args.destination_address_prefix): - args.destination_address_prefix = None - if has_value(args.source_asgs): - args.source_application_security_groups = [{"id": asg_id} for asg_id in args.source_asgs] - if has_value(args.source_address_prefix): - args.source_address_prefix = None - - -class NSGRuleUpdate(_NsgRule.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZResourceIdArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.destination_asgs = AAZListArg( - options=["--destination-asgs"], - arg_group="Destination", - help="Space-separated list of application security group names or IDs. Limited by backend server, " - "temporarily this argument only supports one application security group name or ID.", - nullable=True, - ) - args_schema.destination_asgs.Element = AAZResourceIdArg( - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - args_schema.source_asgs = AAZListArg( - options=["--source-asgs"], - arg_group="Source", - help="Space-separated list of application security group names or IDs. Limited by backend server, " - "temporarily this argument only supports one application security group name or ID.", - nullable=True, - ) - args_schema.source_asgs.Element = AAZResourceIdArg( - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - # filter arguments - args_schema.destination_address_prefix._registered = False - args_schema.destination_application_security_groups._registered = False - args_schema.destination_port_range._registered = False - args_schema.source_address_prefix._registered = False - args_schema.source_application_security_groups._registered = False - args_schema.source_port_range._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - # handle application security groups - args.destination_application_security_groups = assign_aaz_list_arg( - args.destination_application_security_groups, - args.destination_asgs, - element_transformer=lambda _, asg_id: {"id": asg_id} - ) - args.source_application_security_groups = assign_aaz_list_arg( - args.source_application_security_groups, - args.source_asgs, - element_transformer=lambda _, asg_id: {"id": asg_id} - ) - - def pre_instance_update(self, instance): - if instance.properties.sourceAddressPrefix: - instance.properties.sourceAddressPrefixes = [instance.properties.sourceAddressPrefix] - instance.properties.sourceAddressPrefix = None - if instance.properties.destinationAddressPrefix: - instance.properties.destinationAddressPrefixes = [instance.properties.destinationAddressPrefix] - instance.properties.destinationAddressPrefix = None - if instance.properties.sourcePortRange: - instance.properties.sourcePortRanges = [instance.properties.sourcePortRange] - instance.properties.sourcePortRange = None - if instance.properties.destinationPortRange: - instance.properties.destinationPortRanges = [instance.properties.destinationPortRange] - instance.properties.destinationPortRange = None - - def post_instance_update(self, instance): - if instance.properties.sourceAddressPrefixes and len(instance.properties.sourceAddressPrefixes) == 1: - instance.properties.sourceAddressPrefix = instance.properties.sourceAddressPrefixes[0] - instance.properties.sourceAddressPrefixes = None - if instance.properties.destinationAddressPrefixes and len(instance.properties.destinationAddressPrefixes) == 1: - instance.properties.destinationAddressPrefix = instance.properties.destinationAddressPrefixes[0] - instance.properties.destinationAddressPrefixes = None - if instance.properties.sourcePortRanges and len(instance.properties.sourcePortRanges) == 1: - instance.properties.sourcePortRange = instance.properties.sourcePortRanges[0] - instance.properties.sourcePortRanges = None - if instance.properties.destinationPortRanges and len(instance.properties.destinationPortRanges) == 1: - instance.properties.destinationPortRange = instance.properties.destinationPortRanges[0] - instance.properties.destinationPortRanges = None - - -def list_nsg_rules(cmd, resource_group_name, network_security_group_name, include_default=False): - Show = import_aaz_by_profile("network.nsg").Show - nsg = Show(cli_ctx=cmd.cli_ctx)(command_args={ - "resource_group": resource_group_name, - "name": network_security_group_name - }) - - rules = nsg["securityRules"] - return rules + nsg["defaultSecurityRules"] if include_default else rules diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/public_ip.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/public_ip.py deleted file mode 100644 index 89c2971b1bd..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/public_ip.py +++ /dev/null @@ -1,55 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_PublicIP = import_aaz_by_profile("network.public_ip") - - -def create_public_ip(cmd, resource_group_name, public_ip_address_name, location=None, tags=None, - allocation_method=None, dns_name=None, - idle_timeout=4, reverse_fqdn=None, version=None, sku=None, zone=None, - ip_address=None): - public_ip_args = { - 'name': public_ip_address_name, - "resource_group": resource_group_name, - 'location': location, - 'tags': tags, - 'allocation_method': allocation_method, - 'idle_timeout': idle_timeout, - 'ip_address': ip_address, - } - - if sku is None: - logger.warning( - "Please note that the default public IP used for creation will be changed from Basic to Standard " - "in the future." - ) - - if not allocation_method: - if sku and sku.lower() == 'standard': - public_ip_args['allocation_method'] = 'Static' - else: - public_ip_args['allocation_method'] = 'Dynamic' - - public_ip_args['version'] = version - public_ip_args['zone'] = zone - - if sku: - public_ip_args['sku'] = sku - if not sku: - public_ip_args['sku'] = 'Basic' - - if dns_name or reverse_fqdn: - public_ip_args['dns_name'] = dns_name - public_ip_args['reverse_fqdn'] = reverse_fqdn - - PublicIpCreate = import_aaz_by_profile("network.public_ip").Create - return PublicIpCreate(cli_ctx=cmd.cli_ctx)(command_args=public_ip_args) diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/vnet.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/vnet.py deleted file mode 100644 index 0bdfa228756..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/vnet.py +++ /dev/null @@ -1,239 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger - -from azure.cli.core.aaz import has_value -from azure.cli.core.aaz.utils import assign_aaz_list_arg -from azure.cli.core.azclierror import ResourceNotFoundError -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_VNet = import_aaz_by_profile("network.vnet") - - -class VNetCreate(_VNet.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZStrArg, AAZResourceIdArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - # add subnet arguments - args_schema.subnet_name = AAZStrArg( - options=["--subnet-name"], - arg_group="Subnet", - help="Name of a new subnet to create within the VNet.", - ) - args_schema.subnet_prefixes = AAZListArg( - options=["--subnet-prefixes"], - arg_group="Subnet", - help="Space-separated list of address prefixes in CIDR format for the new subnet. If omitted, " - "automatically reserves a /24 (or as large as available) block within the VNet address space.", - ) - args_schema.subnet_prefixes.Element = AAZStrArg() - args_schema.subnet_nsg = AAZResourceIdArg( - options=["--nsg", "--network-security-group"], - arg_group="Subnet", - help="Name or ID of a network security group (NSG).", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ), - ) - # filter arguments - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.subnet_name): - subnet = {"name": args.subnet_name} - if not has_value(args.subnet_prefixes): - # set default value - address, bit_mask = str(args.address_prefixes[0]).split("/") - subnet_mask = 24 if int(bit_mask) < 24 else bit_mask - subnet["address_prefix"] = f"{address}/{subnet_mask}" - elif len(args.subnet_prefixes) == 1: - subnet["address_prefix"] = args.subnet_prefixes[0] - else: - subnet["address_prefixes"] = args.subnet_prefixes - if has_value(args.subnet_nsg): - subnet["network_security_group"] = {"id": args.subnet_nsg} - args.subnets = [subnet] - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return {"newVNet": result} - - -def list_available_ips(cmd, resource_group_name, virtual_network_name): - Show = import_aaz_by_profile("network.vnet").Show - vnet = Show(cli_ctx=cmd.cli_ctx)(command_args={ - "name": virtual_network_name, - "resource_group": resource_group_name, - }) - - start_ip = vnet["addressSpace"]["addressPrefixes"][0].split("/")[0] - - CheckIpAddress = import_aaz_by_profile("network.vnet").CheckIpAddress - return CheckIpAddress(cli_ctx=cmd.cli_ctx)(command_args={ - "name": virtual_network_name, - "resource_group": resource_group_name, - "ip_address": start_ip, - }).get("availableIPAddresses", []) - - -_VNetSubNet = import_aaz_by_profile("network.vnet.subnet") - - -class VNetSubnetCreate(_VNetSubNet.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZStrArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.delegations = AAZListArg( - options=["--delegations"], - help="Space-separated list of services to whom the subnet should be delegated, e.g., Microsoft.Sql/servers." - ) - args_schema.delegations.Element = AAZStrArg() - # add endpoint/policy arguments - args_schema.service_endpoints = AAZListArg( - options=["--service-endpoints"], - help="Space-separated list of services allowed private access to this subnet. " - "Values from: az network vnet list-endpoint-services.", - ) - args_schema.service_endpoints.Element = AAZStrArg() - args_schema.network_security_group._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ) - args_schema.route_table._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/routeTables/{}", - ) - # filter arguments - args_schema.endpoints._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - args.endpoints = assign_aaz_list_arg( - args.endpoints, - args.service_endpoints, - element_transformer=lambda _, service_name: {"service": service_name} - ) - - -class VNetSubnetUpdate(_VNetSubNet.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZStrArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.delegations = AAZListArg( - options=["--delegations"], - help="Space-separated list of services to whom the subnet should be delegated, e.g., Microsoft.Sql/servers.", - nullable=True, - ) - args_schema.delegations.Element = AAZStrArg( - nullable=True, - ) - # add endpoint/policy arguments - args_schema.service_endpoints = AAZListArg( - options=["--service-endpoints"], - help="Space-separated list of services allowed private access to this subnet. " - "Values from: az network vnet list-endpoint-services.", - nullable=True, - ) - args_schema.service_endpoints.Element = AAZStrArg( - nullable=True, - ) - # filter arguments - args_schema.endpoints._registered = False - # handle detach logic - args_schema.network_security_group._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ) - args_schema.route_table._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/routeTables/{}", - ) - return args_schema - - def pre_operations(self): - args = self.ctx.args - args.endpoints = assign_aaz_list_arg( - args.endpoints, - args.service_endpoints, - element_transformer=lambda _, service_name: {"service": service_name} - ) - - def post_instance_update(self, instance): - if not has_value(instance.properties.network_security_group.id): - instance.properties.network_security_group = None - if not has_value(instance.properties.route_table.id): - instance.properties.route_table = None - - -def subnet_list_available_ips(cmd, resource_group_name, virtual_network_name, subnet_name): - Show = import_aaz_by_profile("network.vnet.subnet").Show - subnet = Show(cli_ctx=cmd.cli_ctx)(command_args={ - "name": subnet_name, - "resource_group": resource_group_name, - "vnet_name": virtual_network_name, - }) - - try: - address_prefix = subnet["addressPrefixes"][0] - except KeyError: - address_prefix = subnet["addressPrefix"] - start_ip = address_prefix.split("/")[0] - - CheckIpAddress = import_aaz_by_profile("network.vnet").CheckIpAddress - return CheckIpAddress(cli_ctx=cmd.cli_ctx)(command_args={ - "name": virtual_network_name, - "resource_group": resource_group_name, - "ip_address": start_ip, - }).get("availableIPAddresses", []) - - -_VNetPeering = import_aaz_by_profile("network.vnet.peering") - - -class VNetPeeringCreate(_VNetPeering.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.remote_vnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{}", - ) - return args_schema - - -def sync_vnet_peering(cmd, resource_group_name, virtual_network_name, virtual_network_peering_name): - Show = import_aaz_by_profile("network.vnet.peering").Show - try: - peering = Show(cli_ctx=cmd.cli_ctx)(command_args={ - "name": virtual_network_peering_name, - "resource_group": resource_group_name, - "vnet_name": virtual_network_name, - }) - except ResourceNotFoundError: - err_msg = f"Virtual network peering {virtual_network_name} doesn't exist." - raise ResourceNotFoundError(err_msg) - - Create = import_aaz_by_profile("network.vnet.peering").Create - return Create(cli_ctx=cmd.cli_ctx)(command_args={ - "name": virtual_network_peering_name, - "resource_group": resource_group_name, - "vnet_name": virtual_network_name, - "remote_vnet": peering["remoteVirtualNetwork"].pop("id", None), - "allow_vnet_access": peering.pop("allowVirtualNetworkAccess", None), - "allow_gateway_transit": peering.pop("allowGatewayTransit", None), - "allow_forwarded_traffic": peering.pop("allowForwardedTraffic", None), - "use_remote_gateways": peering.pop("useRemoteGateways", None), - }) diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/vnet_gateway.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/vnet_gateway.py deleted file mode 100644 index 09104f87259..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/vnet_gateway.py +++ /dev/null @@ -1,237 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from azure.cli.core.aaz import AAZListArg, AAZStrArg, AAZResourceIdArg, AAZResourceIdArgFormat, AAZFileArg, \ - AAZFileArgBase64EncodeFormat, has_value -from knack.log import get_logger - -from ._util import import_aaz_by_profile - -logger = get_logger(__name__) - - -_VnetGateway = import_aaz_by_profile("network.vnet_gateway") - - -class VnetGatewayCreate(_VnetGateway.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.public_ip_addresses = AAZListArg( - options=['--public-ip-addresses', '--public-ip-address'], - required=True, - help="Specify a single public IP (name or ID) for an active-standby gateway. Specify two space-separated public IPs for an active-active gateway." - ) - args_schema.public_ip_addresses.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}" - ) - ) - args_schema.vnet = AAZResourceIdArg( - options=['--vnet'], - help="Name or ID of an existing virtual network which has a subnet named 'GatewaySubnet'.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{}" - ) - ) - - args_schema.root_cert_data = AAZFileArg(options=['--root-cert-data'], arg_group="Root Cert Authentication", - help="Base64 contents of the root certificate file or file path.", - fmt=AAZFileArgBase64EncodeFormat()) - args_schema.root_cert_name = AAZStrArg(options=['--root-cert-name'], arg_group="Root Cert Authentication", - help="Root certificate name.") - args_schema.gateway_default_site._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/localNetworkGateways/{}" - ) - args_schema.ip_configurations._registered = False - args_schema.active._registered = False - args_schema.vpn_client_root_certificates._registered = False - args_schema.sku_tier._registered = False - args_schema.enable_bgp._registered = False - - return args_schema - - def pre_operations(self): - args = self.ctx.args - subnet = args.vnet.to_serialized_data() + '/subnets/GatewaySubnet' - args.sku_tier = args.sku - args.active = len(args.public_ip_addresses) == 2 - - args.ip_configurations = [] - if has_value(args.public_ip_addresses): - public_ip_addresses = args.public_ip_addresses.to_serialized_data() - ip_configuration = {} - for i, public_ip in enumerate(public_ip_addresses): - ip_configuration[i] = {'subnet': subnet, 'public_ip_address': public_ip, - 'private_ip_allocation_method': 'Dynamic', - 'name': 'vnetGatewayConfig{}'.format(i)} - args.ip_configurations.append(ip_configuration[i]) - - if has_value(args.asn) or has_value(args.bgp_peering_address) or has_value(args.peer_weight): - args.enable_bgp = True - else: - args.asn = None - args.bgp_peering_address = None - args.peer_weight = None - - if has_value(args.address_prefixes) or has_value(args.client_protocol): - import os - if has_value(args.root_cert_data): - path = os.path.expanduser(args.root_cert_data.to_serialized_data()) - else: - path = None - if has_value(args.root_cert_name): - args.vpn_client_root_certificates = [{'name': args.root_cert_name, 'public_cert_data': path}] - else: - args.vpn_client_root_certificates = [] - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return {'vnetGateway': result} - - -class VnetGatewayUpdate(_VnetGateway.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.public_ip_addresses = AAZListArg( - options=['--public-ip-addresses', '--public-ip-address'], - help="Specify a single public IP (name or ID) for an active-standby gateway. Specify two space-separated public IPs for an active-active gateway." - ) - args_schema.public_ip_addresses.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}" - ), - nullable=True, - ) - args_schema.vnet = AAZResourceIdArg( - options=['--vnet'], - help="Name or ID of an existing virtual network which has a subnet named 'GatewaySubnet'.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{}" - ), - ) - args_schema.root_cert_data = AAZFileArg(options=['--root-cert-data'], arg_group="Root Cert Authentication", - help="Base64 contents of the root certificate file or file path.", - fmt=AAZFileArgBase64EncodeFormat(), nullable=True) - args_schema.root_cert_name = AAZStrArg(options=['--root-cert-name'], arg_group="Root Cert Authentication", - help="Root certificate name.", nullable=True,) - args_schema.gateway_default_site._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/localNetworkGateways/{}" - ) - args_schema.ip_configurations._registered = False - args_schema.active._registered = False - args_schema.vpn_client_root_certificates._registered = False - args_schema.sku_tier._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.root_cert_data): - import os - path = os.path.expanduser(args.root_cert_data.to_serialized_data()) - args.root_cert_data = path - - if has_value(args.sku): - args.sku_tier = args.sku - - def pre_instance_update(self, instance): - args = self.ctx.args - if has_value(args.root_cert_data): - collection = instance.properties.vpn_client_configuration.vpn_client_root_certificates.to_serialized_data() - root_certificate = {'name': args.root_cert_name, 'public_cert_data': args.root_cert_data} - value = args.root_cert_name.to_serialized_data() - match = next((x for x in collection if getattr(x, 'name', None) == value), None) - if match: - collection.remove(match) - collection.append(root_certificate) - args.vpn_client_root_certificates = collection - - subnet_id = '{}/subnets/GatewaySubnet'.format(args.vnet) if has_value(args.vnet) else \ - instance.properties.ip_configurations[0].properties.subnet.id - - if has_value(args.vnet): - if has_value(instance.properties.ip_configurations): - for config in instance.properties.ip_configurations: - config.properties.subnet.id = subnet_id - - if has_value(args.public_ip_addresses): - instance.properties.ip_configurations = [] - public_ip_addresses = args.public_ip_addresses.to_serialized_data() - args.ip_configurations = [] - ip_configuration = {} - for i, public_ip in enumerate(public_ip_addresses): - ip_configuration[i] = {'subnet': subnet_id, 'public_ip_address': {'id': public_ip}, - 'private_ip_allocation_method': 'Dynamic', - 'name': 'vnetGatewayConfig{}'.format(i)} - args.ip_configurations.append(ip_configuration[i]) - - # Update active-active/active-standby status - active = len(args.public_ip_addresses) == 2 - if instance.properties.active_active and not active: - logger.info('Placing gateway in active-standby mode.') - elif not instance.properties.active_active and active: - logger.info('Placing gateway in active-active mode.') - args.active = active - - -_VpnClient = import_aaz_by_profile("network.vnet_gateway.vpn_client") - - -def generate_vpn_client(cmd, resource_group_name, virtual_network_gateway_name, processor_architecture=None, - authentication_method=None, radius_server_auth_certificate=None, client_root_certificates=None, - use_legacy=False): - generate_args = {"name": virtual_network_gateway_name, - "resource_group": resource_group_name, - "processor_architecture": processor_architecture} - if not use_legacy: - generate_args['authentication_method'] = authentication_method - generate_args['radius_server_auth_certificate'] = radius_server_auth_certificate - generate_args['client_root_certificates'] = client_root_certificates - return _VpnClient.GenerateVpnProfile(cli_ctx=cmd.cli_ctx)(command_args=generate_args) - # legacy implementation - return _VpnClient.Generate(cli_ctx=cmd.cli_ctx)(command_args=generate_args) - - -_RevokedCert = import_aaz_by_profile("network.vnet_gateway.revoked_cert") - - -class VnetGatewayRevokedCertCreate(_RevokedCert.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.thumbprint._required = True - - return args_schema - - -_RootCert = import_aaz_by_profile("network.vnet_gateway.root_cert") - - -class VnetGatewayRootCertCreate(_RootCert.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.public_cert_data = AAZFileArg(options=['--public-cert-data'], - help="Base64 contents of the root certificate file or file path.", - required=True, - fmt=AAZFileArgBase64EncodeFormat()) - args_schema.root_cert_data._required = False - args_schema.root_cert_data._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.public_cert_data): - import os - path = os.path.expanduser(args.public_cert_data.to_serialized_data()) - else: - path = None - args.root_cert_data = path diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/vpn_connection.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/vpn_connection.py deleted file mode 100644 index 07c2ee84f82..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2018_03_01_hybrid/operations/vpn_connection.py +++ /dev/null @@ -1,85 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger - -from ._util import import_aaz_by_profile - -logger = get_logger(__name__) - - -_VpnConnection = import_aaz_by_profile("network.vpn_connection") - - -class VpnConnectionUpdate(_VpnConnection.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.ipsec_policies._registered = False - - return args_schema - - -class VpnConnectionDeviceConfigScriptShow(_VpnConnection.ShowDeviceConfigScript): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.device_family._required = True - args_schema.firmware_version._required = True - args_schema.vendor._required = True - - return args_schema - - -_VpnConnIpsecPolicy = import_aaz_by_profile("network.vpn_connection.ipsec_policy") - - -class VpnConnIpsecPolicyAdd(_VpnConnIpsecPolicy.Add): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.ipsec_policy_index._registered = False - return args_schema - - -_VpnConnSharedKey = import_aaz_by_profile("network.vpn_connection.shared_key") - - -class VpnConnSharedKeyUpdate(_VpnConnSharedKey.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.value._required = True - return args_schema - - -def list_vpn_connections(cmd, resource_group_name, virtual_network_gateway_name=None): - if virtual_network_gateway_name: - return _VpnConnection.ListConnection(cli_ctx=cmd.cli_ctx)( - command_args={"resource_group": resource_group_name, - "vnet_gateway": virtual_network_gateway_name}) - return _VpnConnection.List(cli_ctx=cmd.cli_ctx)(command_args={"resource_group": resource_group_name}) - - -def clear_vpn_conn_ipsec_policies(cmd, resource_group_name, connection_name, no_wait=False): - class VpnConnIpsecPoliciesClear(_VpnConnection.Update): - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.properties.ipsec_policies, client_flatten=True) - return result - - def pre_operations(self): - args = self.ctx.args - args.ipsec_policies = None - args.use_policy_based_traffic_selectors = False - - ipsec_policies_args = { - "resource_group": resource_group_name, - "name": connection_name, - "no_wait": no_wait, - } - return VpnConnIpsecPoliciesClear(cli_ctx=cmd.cli_ctx)(command_args=ipsec_policies_args) diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/__init__.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/__init__.py deleted file mode 100644 index 34913fb394d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/_params.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/_params.py deleted file mode 100644 index 749b974106c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/_params.py +++ /dev/null @@ -1,9 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -# pylint: disable=unused-argument, too-many-locals, too-many-branches, too-many-statements -def load_arguments(self, _): - pass diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/commands.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/commands.py deleted file mode 100644 index dee5260df83..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/commands.py +++ /dev/null @@ -1,169 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -# pylint: disable=too-many-locals, too-many-statements, disable=line-too-long -def load_command_table(self, _): - from .operations import import_aaz_by_profile - - # region LoadBalancers - from .operations.load_balancer import LBFrontendIPCreate, LBFrontendIPUpdate - self.command_table["network lb frontend-ip create"] = LBFrontendIPCreate(loader=self) - self.command_table["network lb frontend-ip update"] = LBFrontendIPUpdate(loader=self) - - from .operations.load_balancer import LBInboundNatRuleCreate, LBInboundNatRuleUpdate - self.command_table["network lb inbound-nat-rule create"] = LBInboundNatRuleCreate(loader=self) - self.command_table["network lb inbound-nat-rule update"] = LBInboundNatRuleUpdate(loader=self) - - from .operations.load_balancer import LBInboundNatPoolCreate, LBInboundNatPoolUpdate - self.command_table["network lb inbound-nat-pool create"] = LBInboundNatPoolCreate(loader=self) - self.command_table["network lb inbound-nat-pool update"] = LBInboundNatPoolUpdate(loader=self) - - from .operations.load_balancer import LBRuleCreate, LBRuleUpdate - self.command_table["network lb rule create"] = LBRuleCreate(loader=self) - self.command_table["network lb rule update"] = LBRuleUpdate(loader=self) - - from .operations.load_balancer import LBProbeCreate, LBProbeUpdate - self.command_table["network lb probe create"] = LBProbeCreate(loader=self) - self.command_table["network lb probe update"] = LBProbeUpdate(loader=self) - - # endregion - - # region LocalNetworkGateways - local_gateway = import_aaz_by_profile("network.local_gateway") - - from .._format import transform_local_gateway_table_output - self.command_table['network local-gateway list'] = local_gateway.List( - loader=self, table_transformer=transform_local_gateway_table_output) - - # endregion - - # region NetworkInterfaces - from .._format import transform_effective_nsg, transform_effective_route_table - operations_tmpl = self.get_module_name_by_profile("operations.nic#{}") - nic = import_aaz_by_profile("network.nic") - - from .operations.nic import NICCreate, NICUpdate - self.command_table["network nic create"] = NICCreate(loader=self) - self.command_table["network nic update"] = NICUpdate(loader=self) - self.command_table["network nic list-effective-nsg"] = nic.ListEffectiveNsg(loader=self, table_transformer=transform_effective_nsg) - self.command_table["network nic show-effective-route-table"] = nic.ShowEffectiveRouteTable(loader=self, table_transformer=transform_effective_route_table) - - from .operations.nic import NICIPConfigCreate, NICIPConfigUpdate, NICIPConfigNATAdd, NICIPConfigNATRemove - self.command_table["network nic ip-config create"] = NICIPConfigCreate(loader=self) - self.command_table["network nic ip-config update"] = NICIPConfigUpdate(loader=self) - self.command_table["network nic ip-config inbound-nat-rule add"] = NICIPConfigNATAdd(loader=self) - self.command_table["network nic ip-config inbound-nat-rule remove"] = NICIPConfigNATRemove(loader=self) - - with self.command_group("network nic ip-config address-pool", operations_tmpl=operations_tmpl) as g: - g.custom_command("add", "add_nic_ip_config_address_pool") - g.custom_command("remove", "remove_nic_ip_config_address_pool") - - # endregion - - # region VirtualNetworkGatewayConnections - from .operations.vpn_connection import VpnConnectionUpdate, VpnConnectionDeviceConfigScriptShow - self.command_table['network vpn-connection update'] = VpnConnectionUpdate(loader=self) - self.command_table['network vpn-connection show-device-config-script'] = VpnConnectionDeviceConfigScriptShow( - loader=self) - - from .operations.vpn_connection import VpnConnSharedKeyUpdate - self.command_table['network vpn-connection shared-key update'] = VpnConnSharedKeyUpdate(loader=self) - - from .operations.vpn_connection import VpnConnIpsecPolicyAdd - self.command_table['network vpn-connection ipsec-policy add'] = VpnConnIpsecPolicyAdd(loader=self) - - operations_tmpl = self.get_module_name_by_profile("operations.vpn_connection#{}") - with self.command_group('network vpn-connection', operations_tmpl=operations_tmpl) as g: - g.command('list', 'list_vpn_connections') - g.command('ipsec-policy clear', 'clear_vpn_conn_ipsec_policies', supports_no_wait=True) - - # endregion - - # region VirtualNetworkGateways - from .._format import transform_vnet_gateway_bgp_peer_table, transform_vnet_gateway_routes_table - operations_tmpl = self.get_module_name_by_profile("operations.vnet_gateway#{}") - vnet_gateway = import_aaz_by_profile("network.vnet_gateway") - - self.command_table['network vnet-gateway list-bgp-peer-status'] = vnet_gateway.ListBgpPeerStatus( - loader=self, table_transformer=transform_vnet_gateway_bgp_peer_table) - self.command_table['network vnet-gateway list-advertised-routes'] = vnet_gateway.ListAdvertisedRoutes( - loader=self, table_transformer=transform_vnet_gateway_routes_table) - self.command_table['network vnet-gateway list-learned-routes'] = vnet_gateway.ListLearnedRoutes( - loader=self, table_transformer=transform_vnet_gateway_routes_table) - - from .operations.vnet_gateway import VnetGatewayCreate, VnetGatewayUpdate - self.command_table['network vnet-gateway create'] = VnetGatewayCreate(loader=self) - self.command_table['network vnet-gateway update'] = VnetGatewayUpdate(loader=self) - - with self.command_group('network vnet-gateway vpn-client', operations_tmpl=operations_tmpl) as g: - g.command('generate', 'generate_vpn_client') - - from .operations.vnet_gateway import VnetGatewayRevokedCertCreate - self.command_table['network vnet-gateway revoked-cert create'] = VnetGatewayRevokedCertCreate(loader=self) - - from .operations.vnet_gateway import VnetGatewayRootCertCreate - self.command_table['network vnet-gateway root-cert create'] = VnetGatewayRootCertCreate(loader=self) - - # region VirtualNetwork - from .operations.vnet import VNetCreate, VNetSubnetCreate, VNetSubnetUpdate, VNetPeeringCreate - from .._format import transform_vnet_table_output - vnet = import_aaz_by_profile("network.vnet") - operations_tmpl = self.get_module_name_by_profile("operations.vnet#{}") - self.command_table['network vnet create'] = VNetCreate(loader=self) - self.command_table['network vnet list'] = vnet.List(loader=self, table_transformer=transform_vnet_table_output) - with self.command_group('network vnet', operations_tmpl=operations_tmpl) as g: - g.custom_command("list-available-ips", "list_available_ips", is_preview=True) - - self.command_table['network vnet peering create'] = VNetPeeringCreate(loader=self) - with self.command_group('network vnet peering', operations_tmpl=operations_tmpl) as g: - g.custom_command("sync", "sync_vnet_peering") - - self.command_table['network vnet subnet create'] = VNetSubnetCreate(loader=self) - self.command_table['network vnet subnet update'] = VNetSubnetUpdate(loader=self) - with self.command_group('network vnet subnet', operations_tmpl=operations_tmpl) as g: - g.custom_command("list-available-ips", "subnet_list_available_ips", is_preview=True) - - # endregion - - # region NetworkRoot - with self.command_group('network'): - from .operations.locations import UsagesList - from .._format import transform_network_usage_table - self.command_table['network list-usages'] = UsagesList(loader=self, - table_transformer=transform_network_usage_table) - # endregion - - # region PublicIPAddresses - public_ip_show_table_transform = '{Name:name, ResourceGroup:resourceGroup, Location:location, $zone$Address:ipAddress, AddressVersion:publicIpAddressVersion, AllocationMethod:publicIpAllocationMethod, IdleTimeoutInMinutes:idleTimeoutInMinutes, ProvisioningState:provisioningState}' - public_ip_show_table_transform = public_ip_show_table_transform.replace('$zone$', 'Zones: (!zones && \' \') || join(` `, zones), ') - - public_ip = import_aaz_by_profile("network.public_ip") - operations_tmpl = self.get_module_name_by_profile("operations.public_ip#{}") - from .._format import transform_public_ip_create_output - from .._validators import process_public_ip_create_namespace - - with self.command_group('network public-ip', operations_tmpl=operations_tmpl) as g: - g.custom_command("create", "create_public_ip", transform=transform_public_ip_create_output, validator=process_public_ip_create_namespace) - - self.command_table['network public-ip list'] = public_ip.List(loader=self, table_transformer='[].' + public_ip_show_table_transform) - self.command_table['network public-ip show'] = public_ip.Show(loader=self, table_transformer=public_ip_show_table_transform) - - # endregion - - # region NetworkSecurityGroups - from .operations.nsg import NSGCreate, NSGRuleCreate, NSGRuleUpdate - from .._format import transform_nsg_rule_table_output - operations_tmpl = self.get_module_name_by_profile("operations.nsg#{}") - nsgRule = import_aaz_by_profile("network.nsg.rule") - self.command_table["network nsg create"] = NSGCreate(loader=self) - - self.command_table["network nsg rule create"] = NSGRuleCreate(loader=self) - self.command_table["network nsg rule update"] = NSGRuleUpdate(loader=self) - - self.command_table["network nsg rule show"] = nsgRule.Show(loader=self, table_transformer=transform_nsg_rule_table_output) - with self.command_group("network nsg rule", operations_tmpl=operations_tmpl) as g: - g.custom_command("list", "list_nsg_rules", table_transformer=lambda x: [transform_nsg_rule_table_output(i) for i in x]) - # endregion diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/__init__.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/__init__.py deleted file mode 100644 index fca9bdf191e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-import -from ._util import import_aaz_by_profile diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/_util.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/_util.py deleted file mode 100644 index 7f0f515e93c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/_util.py +++ /dev/null @@ -1,10 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -import importlib - - -def import_aaz_by_profile(module_name): - # use aaz in 2018-03-01-hybrid profile, because apis are the some. - return importlib.import_module(f"azure.cli.command_modules.network.aaz.profile_2018_03_01_hybrid.{module_name}") diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/load_balancer.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/load_balancer.py deleted file mode 100644 index a5f5b6c3e51..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/load_balancer.py +++ /dev/null @@ -1,306 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger -from azure.cli.core.azclierror import ArgumentUsageError -from azure.cli.core.aaz import AAZResourceIdArgFormat, has_value, AAZStrArg, AAZArgEnum -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_LBFrontendIP = import_aaz_by_profile("network.lb.frontend_ip") - - -class LBFrontendIPCreate(_LBFrontendIP.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - arg_group="Properties", - options=['--vnet-name'], - help="The virtual network (VNet) associated with the subnet (Omit if supplying a subnet id)." - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}", - ) - - args_schema.zones.Element.enum = AAZArgEnum({ - "1": "1", - "2": "2", - "3": "3", - }) - args_schema.private_ip_allocation_method._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.subnet) and has_value(args.public_ip_address): - raise ArgumentUsageError( - 'incorrect usage: --subnet NAME --vnet-name NAME | ' - '--subnet ID | --public-ip-address NAME_OR_ID') - - if not has_value(args.public_ip_address): - logger.warning( - "Please note that the default public IP used for LB frontend will be changed from Basic to Standard " - "in the future." - ) - - if has_value(args.private_ip_address): - args.private_ip_allocation_method = 'Static' - else: - args.private_ip_allocation_method = 'Dynamic' - - -class LBFrontendIPUpdate(_LBFrontendIP.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - arg_group="Properties", - options=['--vnet-name'], - help="The virtual network (VNet) associated with the subnet (Omit if supplying a subnet id)." - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}", - ) - - args_schema.zones.Element.enum = AAZArgEnum({ - "1": "1", - "2": "2", - "3": "3", - }) - args_schema.private_ip_allocation_method._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.private_ip_address): - # update private_ip_address - if args.private_ip_address: - args.private_ip_allocation_method = 'Static' - else: - # set private_ip_address as null value - args.private_ip_allocation_method = 'Dynamic' - - def post_instance_update(self, instance): - if not has_value(instance.properties.subnet.id): - instance.properties.subnet = None - if not has_value(instance.properties.public_ip_address.id): - instance.properties.public_ip_address = None - - -_LBInboundNatPool = import_aaz_by_profile("network.lb.inbound_nat_pool") - - -class LBInboundNatPoolCreate(_LBInboundNatPool.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - - args_schema.protocol._required = True - args_schema.backend_port._required = True - args_schema.frontend_port_range_start._required = True - args_schema.frontend_port_range_end._required = True - return args_schema - - def pre_instance_create(self): - args = self.ctx.args - if not has_value(args.frontend_ip_name): - instance = self.ctx.vars.instance - frontend_ip_configurations = instance.properties.frontend_ip_configurations - if len(frontend_ip_configurations) == 1: - args.frontend_ip_name = instance.properties.frontend_ip_configurations[0].id - elif len(frontend_ip_configurations) > 1: - raise ArgumentUsageError("Multiple FrontendIpConfigurations found in loadbalancer. Specify --frontend-ip explicitly.") - - -class LBInboundNatPoolUpdate(_LBInboundNatPool.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - - args_schema.protocol._nullable = False - args_schema.backend_port._nullable = False - args_schema.frontend_port_range_start._nullable = False - args_schema.frontend_port_range_end._nullable = False - return args_schema - - def post_instance_update(self, instance): - if not has_value(instance.properties.frontend_ip_configuration.id): - instance.properties.frontend_ip_configuration = None - - -_LBInboundNatRule = import_aaz_by_profile("network.lb.inbound_nat_rule") - - -class LBInboundNatRuleCreate(_LBInboundNatRule.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - - # required for a public load balancer - args_schema.protocol._required = True - args_schema.backend_port._required = True - return args_schema - - def pre_instance_create(self): - args = self.ctx.args - if not has_value(args.frontend_ip_name): - instance = self.ctx.vars.instance - frontend_ip_configurations = instance.properties.frontend_ip_configurations - if len(frontend_ip_configurations) == 1: - args.frontend_ip_name = instance.properties.frontend_ip_configurations[0].id - elif len(frontend_ip_configurations) > 1: - raise ArgumentUsageError("Multiple FrontendIpConfigurations found in loadbalancer. Specify --frontend-ip explicitly.") - - -class LBInboundNatRuleUpdate(_LBInboundNatRule.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - return args_schema - - def post_instance_update(self, instance): - if not has_value(instance.properties.frontend_ip_configuration.id): - instance.properties.frontend_ip_configuration = None - - -_LBRule = import_aaz_by_profile("network.lb.rule") - - -class LBRuleCreate(_LBRule.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - args_schema.probe_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/probes/{}" - ) - args_schema.backend_address_pool._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/backendAddressPools/{}" - ) - - args_schema.protocol._required = True - args_schema.frontend_port._required = True - args_schema.backend_port._required = True - - return args_schema - - def pre_instance_create(self): - args = self.ctx.args - if not has_value(args.frontend_ip_name): - instance = self.ctx.vars.instance - frontend_ip_configurations = instance.properties.frontend_ip_configurations - if len(frontend_ip_configurations) == 1: - args.frontend_ip_name = instance.properties.frontend_ip_configurations[0].id - elif len(frontend_ip_configurations) > 1: - raise ArgumentUsageError( - "Multiple FrontendIpConfigurations found in loadbalancer. Specify --frontend-ip explicitly.") - if not has_value(args.backend_address_pool): - instance = self.ctx.vars.instance - backend_address_pools = instance.properties.backend_address_pools - if len(backend_address_pools) == 1: - args.backend_address_pool = instance.properties.backend_address_pools[0].id - elif len(backend_address_pools) > 1: - raise ArgumentUsageError( - "Multiple BackendAddressPools found in loadbalancer. Specify --backend-pool-name explicitly.") - - -class LBRuleUpdate(_LBRule.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - args_schema.probe_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/probes/{}" - ) - - args_schema.backend_address_pool._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/backendAddressPools/{}" - ) - - args_schema.protocol._nullable = False - args_schema.frontend_port._nullable = False - args_schema.backend_port._nullable = False - return args_schema - - def post_instance_update(self, instance): - if not has_value(instance.properties.frontend_ip_configuration.id): - instance.properties.frontend_ip_configuration = None - if not has_value(instance.properties.probe.id): - instance.properties.probe = None - if not has_value(instance.properties.backend_address_pool.id): - instance.properties.backend_address_pool = None - - -_LBProbe = import_aaz_by_profile("network.lb.probe") - - -class LBProbeCreate(_LBProbe.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.port._required = True - args_schema.protocol._required = True - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.request_path) and args.request_path == "": - args.request_path = None - - -class LBProbeUpdate(_LBProbe.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.port._nullable = False - args_schema.protocol._nullable = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.request_path) and args.request_path == "": - args.request_path = None diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/locations.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/locations.py deleted file mode 100644 index 4167fb38678..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/locations.py +++ /dev/null @@ -1,22 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from ._util import import_aaz_by_profile - - -_NetWork = import_aaz_by_profile("network") - - -class UsagesList(_NetWork.ListUsages): - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - result = list(result) - for item in result: - item['currentValue'] = str(item['currentValue']) - item['limit'] = str(item['limit']) - item['localName'] = item['name']['localizedValue'] - return result, next_link -# endregion diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/nic.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/nic.py deleted file mode 100644 index 226bd8ddf73..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/nic.py +++ /dev/null @@ -1,528 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods, unused-argument -from azure.cli.core.aaz import AAZResourceIdArgFormat, has_value, AAZListArg, AAZResourceIdArg, \ - AAZStrArg -from azure.cli.core.aaz.utils import assign_aaz_list_arg -from knack.log import get_logger - -from ._util import import_aaz_by_profile - -logger = get_logger(__name__) - - -_NIC = import_aaz_by_profile("network.nic") - - -class NICCreate(_NIC.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - arg_group="IP Configuration", - help="Name of the virtual network.", - ) - args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="IP Configuration", - help="Name or ID of an existing subnet. If name specified, please also specify `--vnet-name`; " - "If you want to use an existing subnet in other resource group, " - "please provide the ID instead of the name of the subnet.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/virtualNetworks/{vnet_name}/subnets/{}", - ), - ) - args_schema.application_security_groups = AAZListArg( - options=["--application-security-groups", "--asgs"], - arg_group="IP Configuration", - help="Space-separated list of application security groups.", - ) - args_schema.application_security_groups.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="IP Configuration", - help="Static private IP address to use.", - ) - args_schema.private_ip_address_version = AAZStrArg( - options=["--private-ip-address-version"], - arg_group="IP Configuration", - help="Version of private IP address to use.", - enum=["IPv4", "IPv6"], - default="IPv4", - ) - args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="IP Configuration", - help="Name or ID of an existing public IP address.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/" - "publicIPAddresses/{}" - ), - ) - args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - arg_group="Application Gateway", - help="Name of the application gateway." - ) - args_schema.app_gateway_address_pools = AAZListArg( - options=["--app-gateway-address-pools", "--ag-address-pools"], - arg_group="Application Gateway", - help="Space-separated list of names or IDs of application gateway backend address pools to " - "associate with the NIC. If names are used, `--gateway-name` must be specified.", - ) - args_schema.app_gateway_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationGateways/{gateway_name}/backendAddressPools/{}", - ), - ) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - arg_group="Load Balancer", - help="Name of the load balancer", - ) - args_schema.lb_address_pools = AAZListArg( - options=["--lb-address-pools"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer address pools to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/backendAddressPools/{}", - ), - ) - args_schema.lb_inbound_nat_rules = AAZListArg( - options=["--lb-inbound-nat-rules"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer inbound NAT rules to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_inbound_nat_rules.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ), - ) - args_schema.network_security_group = AAZResourceIdArg( - options=["--network-security-group"], - help="Name or ID of an existing network security group", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ), - ) - args_schema.ip_configurations._registered = False - args_schema.nsg._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.network_security_group): - args.nsg.id = args.network_security_group - ip_configuration = { - "name": "ipconfig1", - "private_ip_address": args.private_ip_address, - "private_ip_address_version": args.private_ip_address_version, # when address doesn't exist, version should be ipv4 (default) - "private_ip_allocation_method": "Static" if has_value(args.private_ip_address) else "Dynamic", - "subnet": {"id": args.subnet} if has_value(args.subnet) else None, - "public_ip_address": {"id": args.public_ip_address} if has_value(args.public_ip_address) else None, - "application_security_groups": [{"id": x} for x in args.application_security_groups] if has_value(args.application_security_groups) else None, - "application_gateway_backend_address_pools": [{"id": x} for x in args.app_gateway_address_pools] if has_value(args.app_gateway_address_pools) else None, - "load_balancer_backend_address_pools": [{"id": x} for x in args.lb_address_pools] if has_value(args.lb_address_pools) else None, - "load_balancer_inbound_nat_rules": [{"id": x} for x in args.lb_inbound_nat_rules] if has_value(args.lb_inbound_nat_rules) else None, - } - args.ip_configurations = [ip_configuration] - - def _output(self, *args, **kwargs): - result = super()._output(*args, **kwargs) - return {"NewNIC": result} - - -class NICUpdate(_NIC.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.network_security_group = AAZResourceIdArg( - options=["--network-security-group"], - help="Name or ID of an existing network security group", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ), - nullable=True, - ) - args_schema.nsg._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.network_security_group): - args.nsg.id = args.network_security_group - if has_value(args.internal_dns_name) and args.internal_dns_name == "": - args.internal_dns_name = None - - def post_instance_update(self, instance): - if not has_value(instance.properties.network_security_group.id): - instance.properties.network_security_group = None - - -_NICIPConfig = import_aaz_by_profile("network.nic.ip_config") - - -class NICIPConfigCreate(_NICIPConfig.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - arg_group="IP Configuration", - help="Name of the virtual network.", - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/" - "publicIPAddresses/{}" - ) - args_schema.application_security_groups = AAZListArg( - options=["--application-security-groups", "--asgs"], - arg_group="IP Configuration", - help="Space-separated list of application security groups.", - ) - args_schema.application_security_groups.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - arg_group="Application Gateway", - help="Name of the application gateway." - ) - args_schema.app_gateway_address_pools = AAZListArg( - options=["--app-gateway-address-pools", "--ag-address-pools"], - arg_group="Application Gateway", - help="Space-separated list of names or IDs of application gateway backend address pools to " - "associate with the NIC. If names are used, `--gateway-name` must be specified.", - ) - args_schema.app_gateway_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationGateways/{gateway_name}/backendAddressPools/{}", - ), - ) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - arg_group="Load Balancer", - help="Name of the load balancer", - ) - args_schema.lb_address_pools = AAZListArg( - options=["--lb-address-pools"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer address pools to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/backendAddressPools/{}", - ), - ) - args_schema.lb_inbound_nat_rules = AAZListArg( - options=["--lb-inbound-nat-rules"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer inbound NAT rules to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_inbound_nat_rules.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ), - ) - args_schema.application_gateway_backend_address_pools._registered = False - args_schema.load_balancer_backend_address_pools._registered = False - args_schema.load_balancer_inbound_nat_rules._registered = False - args_schema.private_ip_allocation_method._registered = False - args_schema.asgs_obj._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - args.private_ip_allocation_method = "Static" if has_value(args.private_ip_address) else "Dynamic" - - args.asgs_obj = assign_aaz_list_arg( - args.asgs_obj, - args.application_security_groups, - element_transformer=lambda _, asg_id: {"id": asg_id} - ) - args.application_gateway_backend_address_pools = assign_aaz_list_arg( - args.application_gateway_backend_address_pools, - args.app_gateway_address_pools, - element_transformer=lambda _, pool_id: {"id": pool_id} - ) - args.load_balancer_backend_address_pools = assign_aaz_list_arg( - args.load_balancer_backend_address_pools, - args.lb_address_pools, - element_transformer=lambda _, pool_id: {"id": pool_id} - ) - args.load_balancer_inbound_nat_rules = assign_aaz_list_arg( - args.load_balancer_inbound_nat_rules, - args.lb_inbound_nat_rules, - element_transformer=lambda _, rule_id: {"id": rule_id} - ) - - def pre_instance_create(self): - args = self.ctx.args - instance = self.ctx.vars.instance - if args.private_ip_address_version.to_serialized_data().lower() == "ipv4" and not has_value(args.subnet): - primary = next(x for x in instance.properties.ip_configurations if x.properties.primary) - args.subnet = primary.properties.subnet.id - if args.make_primary.to_serialized_data(): - for config in instance.properties.ip_configurations: - config.properties.primary = False - - -class NICIPConfigUpdate(_NICIPConfig.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - arg_group="IP Configuration", - help="Name of the virtual network.", - nullable=True, - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/" - "publicIPAddresses/{}" - ) - args_schema.application_security_groups = AAZListArg( - options=["--application-security-groups", "--asgs"], - arg_group="IP Configuration", - help="Space-separated list of application security groups.", - nullable=True, - ) - args_schema.application_security_groups.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - nullable=True, - ) - args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - arg_group="Application Gateway", - help="Name of the application gateway.", - nullable=True, - ) - args_schema.app_gateway_address_pools = AAZListArg( - options=["--app-gateway-address-pools", "--ag-address-pools"], - arg_group="Application Gateway", - help="Space-separated list of names or IDs of application gateway backend address pools to " - "associate with the NIC. If names are used, `--gateway-name` must be specified.", - nullable=True, - ) - args_schema.app_gateway_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationGateways/{gateway_name}/backendAddressPools/{}", - ), - nullable=True, - ) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - arg_group="Load Balancer", - help="Name of the load balancer", - nullable=True, - ) - args_schema.lb_address_pools = AAZListArg( - options=["--lb-address-pools"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer address pools to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - nullable=True, - ) - args_schema.lb_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/backendAddressPools/{}", - ), - nullable=True, - ) - args_schema.lb_inbound_nat_rules = AAZListArg( - options=["--lb-inbound-nat-rules"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer inbound NAT rules to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - nullable=True, - ) - args_schema.lb_inbound_nat_rules.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ), - nullable=True, - ) - args_schema.application_gateway_backend_address_pools._registered = False - args_schema.load_balancer_backend_address_pools._registered = False - args_schema.load_balancer_inbound_nat_rules._registered = False - args_schema.private_ip_allocation_method._registered = False - args_schema.asgs_obj._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.private_ip_address): - if args.private_ip_address is None or args.private_ip_address == "": - # switch private IP address allocation to dynamic if empty string is used - args.private_ip_address = None - args.private_ip_allocation_method = "Dynamic" - args.private_ip_address_version = "IPv4" - else: - # if specific address provided, allocation is static - args.private_ip_allocation_method = "Static" - - def pre_instance_update(self, instance): - args = self.ctx.args - instance = self.ctx.vars.instance - args.asgs_obj = assign_aaz_list_arg( - args.asgs_obj, - args.application_security_groups, - element_transformer=lambda _, asg_id: {"id": asg_id} - ) - args.application_gateway_backend_address_pools = assign_aaz_list_arg( - args.application_gateway_backend_address_pools, - args.app_gateway_address_pools, - element_transformer=lambda _, pool_id: {"id": pool_id} - ) - args.load_balancer_backend_address_pools = assign_aaz_list_arg( - args.load_balancer_backend_address_pools, - args.lb_address_pools, - element_transformer=lambda _, pool_id: {"id": pool_id} - ) - args.load_balancer_inbound_nat_rules = assign_aaz_list_arg( - args.load_balancer_inbound_nat_rules, - args.lb_inbound_nat_rules, - element_transformer=lambda _, rule_id: {"id": rule_id} - ) - # all ip configurations must belong to the same asgs - is_primary = args.make_primary.to_serialized_data() - for config in instance.properties.ip_configurations: - if is_primary: - config.properties.primary = False - config.properties.application_security_groups = args.asgs_obj - - def post_instance_update(self, instance): - if not has_value(instance.properties.subnet.id): - instance.properties.subnet = None - if not has_value(instance.properties.public_ip_address.id): - instance.properties.public_ip_address = None - - -_LBPool = import_aaz_by_profile("network.nic.ip_config.lb_pool") - -_AGPool = import_aaz_by_profile("network.nic.ip_config.ag_pool") - - -def add_nic_ip_config_address_pool(cmd, resource_group_name, network_interface_name, ip_config_name, - backend_address_pool, load_balancer_name=None, application_gateway_name=None): - - class LBPoolAdd(_LBPool.Add): - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result["ipConfigurations"][0] - - class AGPoolAdd(_AGPool.Add): - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result["ipConfigurations"][0] - - arguments = { - "ip_config_name": ip_config_name, - "nic_name": network_interface_name, - "resource_group": resource_group_name, - "pool_id": backend_address_pool - } - if load_balancer_name: - return LBPoolAdd(cli_ctx=cmd.cli_ctx)(command_args=arguments) - if application_gateway_name: - return AGPoolAdd(cli_ctx=cmd.cli_ctx)(command_args=arguments) - - -def remove_nic_ip_config_address_pool(cmd, resource_group_name, network_interface_name, ip_config_name, - backend_address_pool, load_balancer_name=None, application_gateway_name=None): - LBPoolRemove = _LBPool.Remove - AGPoolRemove = _AGPool.Remove - arguments = { - "ip_config_name": ip_config_name, - "nic_name": network_interface_name, - "resource_group": resource_group_name, - "pool_id": backend_address_pool - } - if load_balancer_name: - return LBPoolRemove(cli_ctx=cmd.cli_ctx)(command_args=arguments) - if application_gateway_name: - return AGPoolRemove(cli_ctx=cmd.cli_ctx)(command_args=arguments) - - -_NICIPConfigNAT = import_aaz_by_profile("network.nic.ip_config.inbound_nat_rule") - - -class NICIPConfigNATAdd(_NICIPConfigNAT.Add): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="Name of the load balancer", - ) - args_schema.inbound_nat_rule._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ) - return args_schema - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result["ipConfigurations"][0] - - -class NICIPConfigNATRemove(_NICIPConfigNAT.Remove): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="Name of the load balancer", - ) - args_schema.inbound_nat_rule._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ) - return args_schema diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/nsg.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/nsg.py deleted file mode 100644 index 76188d98d46..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/nsg.py +++ /dev/null @@ -1,184 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger - -from azure.cli.core.aaz import has_value -from azure.cli.core.aaz.utils import assign_aaz_list_arg -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_Nsg = import_aaz_by_profile("network.nsg") -_NsgRule = import_aaz_by_profile("network.nsg.rule") - - -class NSGCreate(_Nsg.Create): - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return {"NewNSG": result} - - -def _handle_plural_or_singular(args, plural_name, singular_name): - values = getattr(args, plural_name) - if not has_value(values): - return - - setattr(args, plural_name, values if len(values) > 1 else None) - setattr(args, singular_name, values[0] if len(values) == 1 else None) - - -class NSGRuleCreate(_NsgRule.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZResourceIdArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.priority._required = True - args_schema.destination_asgs = AAZListArg( - options=["--destination-asgs"], - arg_group="Destination", - help="Space-separated list of application security group names or IDs. Limited by backend server, " - "temporarily this argument only supports one application security group name or ID.", - ) - args_schema.destination_asgs.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - args_schema.source_asgs = AAZListArg( - options=["--source-asgs"], - arg_group="Source", - help="Space-separated list of application security group names or IDs. Limited by backend server, " - "temporarily this argument only supports one application security group name or ID.", - ) - args_schema.source_asgs.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - # filter arguments - args_schema.destination_address_prefix._registered = False - args_schema.destination_application_security_groups._registered = False - args_schema.destination_port_range._registered = False - args_schema.source_address_prefix._registered = False - args_schema.source_application_security_groups._registered = False - args_schema.source_port_range._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - _handle_plural_or_singular(args, "destination_address_prefixes", "destination_address_prefix") - _handle_plural_or_singular(args, "destination_port_ranges", "destination_port_range") - _handle_plural_or_singular(args, "source_address_prefixes", "source_address_prefix") - _handle_plural_or_singular(args, "source_port_ranges", "source_port_range") - # handle application security groups - if has_value(args.destination_asgs): - args.destination_application_security_groups = [{"id": asg_id} for asg_id in args.destination_asgs] - if has_value(args.destination_address_prefix): - args.destination_address_prefix = None - if has_value(args.source_asgs): - args.source_application_security_groups = [{"id": asg_id} for asg_id in args.source_asgs] - if has_value(args.source_address_prefix): - args.source_address_prefix = None - - -class NSGRuleUpdate(_NsgRule.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZResourceIdArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.destination_asgs = AAZListArg( - options=["--destination-asgs"], - arg_group="Destination", - help="Space-separated list of application security group names or IDs. Limited by backend server, " - "temporarily this argument only supports one application security group name or ID.", - nullable=True, - ) - args_schema.destination_asgs.Element = AAZResourceIdArg( - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - args_schema.source_asgs = AAZListArg( - options=["--source-asgs"], - arg_group="Source", - help="Space-separated list of application security group names or IDs. Limited by backend server, " - "temporarily this argument only supports one application security group name or ID.", - nullable=True, - ) - args_schema.source_asgs.Element = AAZResourceIdArg( - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - # filter arguments - args_schema.destination_address_prefix._registered = False - args_schema.destination_application_security_groups._registered = False - args_schema.destination_port_range._registered = False - args_schema.source_address_prefix._registered = False - args_schema.source_application_security_groups._registered = False - args_schema.source_port_range._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - # handle application security groups - args.destination_application_security_groups = assign_aaz_list_arg( - args.destination_application_security_groups, - args.destination_asgs, - element_transformer=lambda _, asg_id: {"id": asg_id} - ) - args.source_application_security_groups = assign_aaz_list_arg( - args.source_application_security_groups, - args.source_asgs, - element_transformer=lambda _, asg_id: {"id": asg_id} - ) - - def pre_instance_update(self, instance): - if instance.properties.sourceAddressPrefix: - instance.properties.sourceAddressPrefixes = [instance.properties.sourceAddressPrefix] - instance.properties.sourceAddressPrefix = None - if instance.properties.destinationAddressPrefix: - instance.properties.destinationAddressPrefixes = [instance.properties.destinationAddressPrefix] - instance.properties.destinationAddressPrefix = None - if instance.properties.sourcePortRange: - instance.properties.sourcePortRanges = [instance.properties.sourcePortRange] - instance.properties.sourcePortRange = None - if instance.properties.destinationPortRange: - instance.properties.destinationPortRanges = [instance.properties.destinationPortRange] - instance.properties.destinationPortRange = None - - def post_instance_update(self, instance): - if instance.properties.sourceAddressPrefixes and len(instance.properties.sourceAddressPrefixes) == 1: - instance.properties.sourceAddressPrefix = instance.properties.sourceAddressPrefixes[0] - instance.properties.sourceAddressPrefixes = None - if instance.properties.destinationAddressPrefixes and len(instance.properties.destinationAddressPrefixes) == 1: - instance.properties.destinationAddressPrefix = instance.properties.destinationAddressPrefixes[0] - instance.properties.destinationAddressPrefixes = None - if instance.properties.sourcePortRanges and len(instance.properties.sourcePortRanges) == 1: - instance.properties.sourcePortRange = instance.properties.sourcePortRanges[0] - instance.properties.sourcePortRanges = None - if instance.properties.destinationPortRanges and len(instance.properties.destinationPortRanges) == 1: - instance.properties.destinationPortRange = instance.properties.destinationPortRanges[0] - instance.properties.destinationPortRanges = None - - -def list_nsg_rules(cmd, resource_group_name, network_security_group_name, include_default=False): - Show = import_aaz_by_profile("network.nsg").Show - nsg = Show(cli_ctx=cmd.cli_ctx)(command_args={ - "resource_group": resource_group_name, - "name": network_security_group_name - }) - - rules = nsg["securityRules"] - return rules + nsg["defaultSecurityRules"] if include_default else rules diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/public_ip.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/public_ip.py deleted file mode 100644 index 89c2971b1bd..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/public_ip.py +++ /dev/null @@ -1,55 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_PublicIP = import_aaz_by_profile("network.public_ip") - - -def create_public_ip(cmd, resource_group_name, public_ip_address_name, location=None, tags=None, - allocation_method=None, dns_name=None, - idle_timeout=4, reverse_fqdn=None, version=None, sku=None, zone=None, - ip_address=None): - public_ip_args = { - 'name': public_ip_address_name, - "resource_group": resource_group_name, - 'location': location, - 'tags': tags, - 'allocation_method': allocation_method, - 'idle_timeout': idle_timeout, - 'ip_address': ip_address, - } - - if sku is None: - logger.warning( - "Please note that the default public IP used for creation will be changed from Basic to Standard " - "in the future." - ) - - if not allocation_method: - if sku and sku.lower() == 'standard': - public_ip_args['allocation_method'] = 'Static' - else: - public_ip_args['allocation_method'] = 'Dynamic' - - public_ip_args['version'] = version - public_ip_args['zone'] = zone - - if sku: - public_ip_args['sku'] = sku - if not sku: - public_ip_args['sku'] = 'Basic' - - if dns_name or reverse_fqdn: - public_ip_args['dns_name'] = dns_name - public_ip_args['reverse_fqdn'] = reverse_fqdn - - PublicIpCreate = import_aaz_by_profile("network.public_ip").Create - return PublicIpCreate(cli_ctx=cmd.cli_ctx)(command_args=public_ip_args) diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/vnet.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/vnet.py deleted file mode 100644 index 974f9903fc3..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/vnet.py +++ /dev/null @@ -1,240 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger - -from azure.cli.core.aaz import has_value -from azure.cli.core.aaz.utils import assign_aaz_list_arg -from azure.cli.core.azclierror import ResourceNotFoundError -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_VNet = import_aaz_by_profile("network.vnet") - - -class VNetCreate(_VNet.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZStrArg, AAZResourceIdArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - # add subnet arguments - args_schema.subnet_name = AAZStrArg( - options=["--subnet-name"], - arg_group="Subnet", - help="Name of a new subnet to create within the VNet.", - ) - args_schema.subnet_prefixes = AAZListArg( - options=["--subnet-prefixes"], - arg_group="Subnet", - help="Space-separated list of address prefixes in CIDR format for the new subnet. If omitted, " - "automatically reserves a /24 (or as large as available) block within the VNet address space.", - ) - args_schema.subnet_prefixes.Element = AAZStrArg() - args_schema.subnet_nsg = AAZResourceIdArg( - options=["--nsg", "--network-security-group"], - arg_group="Subnet", - help="Name or ID of a network security group (NSG).", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ), - ) - # filter arguments - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.subnet_name): - subnet = {"name": args.subnet_name} - if not has_value(args.subnet_prefixes): - # set default value - address, bit_mask = str(args.address_prefixes[0]).split("/") - subnet_mask = 24 if int(bit_mask) < 24 else bit_mask - subnet["address_prefix"] = f"{address}/{subnet_mask}" - elif len(args.subnet_prefixes) == 1: - subnet["address_prefix"] = args.subnet_prefixes[0] - else: - subnet["address_prefixes"] = args.subnet_prefixes - if has_value(args.subnet_nsg): - subnet["network_security_group"] = {"id": args.subnet_nsg} - args.subnets = [subnet] - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return {"newVNet": result} - - -def list_available_ips(cmd, resource_group_name, virtual_network_name): - Show = import_aaz_by_profile("network.vnet").Show - vnet = Show(cli_ctx=cmd.cli_ctx)(command_args={ - "name": virtual_network_name, - "resource_group": resource_group_name, - }) - - start_ip = vnet["addressSpace"]["addressPrefixes"][0].split("/")[0] - - CheckIpAddress = import_aaz_by_profile("network.vnet").CheckIpAddress - return CheckIpAddress(cli_ctx=cmd.cli_ctx)(command_args={ - "name": virtual_network_name, - "resource_group": resource_group_name, - "ip_address": start_ip, - }).get("availableIPAddresses", []) - - -_VNetSubNet = import_aaz_by_profile("network.vnet.subnet") - - -class VNetSubnetCreate(_VNetSubNet.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZStrArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.delegations = AAZListArg( - options=["--delegations"], - help="Space-separated list of services to whom the subnet should be delegated, e.g., Microsoft.Sql/servers." - ) - args_schema.delegations.Element = AAZStrArg() - # add endpoint/policy arguments - args_schema.service_endpoints = AAZListArg( - options=["--service-endpoints"], - help="Space-separated list of services allowed private access to this subnet. " - "Values from: az network vnet list-endpoint-services.", - ) - args_schema.service_endpoints.Element = AAZStrArg() - args_schema.network_security_group._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ) - args_schema.route_table._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/routeTables/{}", - ) - # filter arguments - args_schema.endpoints._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - args.endpoints = assign_aaz_list_arg( - args.endpoints, - args.service_endpoints, - element_transformer=lambda _, service_name: {"service": service_name} - ) - - -class VNetSubnetUpdate(_VNetSubNet.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZStrArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.delegations = AAZListArg( - options=["--delegations"], - help="Space-separated list of services to whom the subnet should be delegated, e.g., Microsoft.Sql/servers.", - nullable=True, - ) - args_schema.delegations.Element = AAZStrArg( - nullable=True, - ) - # add endpoint/policy arguments - args_schema.service_endpoints = AAZListArg( - options=["--service-endpoints"], - help="Space-separated list of services allowed private access to this subnet. " - "Values from: az network vnet list-endpoint-services.", - nullable=True, - ) - args_schema.service_endpoints.Element = AAZStrArg( - nullable=True, - ) - # filter arguments - args_schema.address_prefix._registered = False - args_schema.endpoints._registered = False - # handle detach logic - args_schema.network_security_group._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ) - args_schema.route_table._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/routeTables/{}", - ) - return args_schema - - def pre_operations(self): - args = self.ctx.args - args.endpoints = assign_aaz_list_arg( - args.endpoints, - args.service_endpoints, - element_transformer=lambda _, service_name: {"service": service_name} - ) - - def post_instance_update(self, instance): - if not has_value(instance.properties.network_security_group.id): - instance.properties.network_security_group = None - if not has_value(instance.properties.route_table.id): - instance.properties.route_table = None - - -def subnet_list_available_ips(cmd, resource_group_name, virtual_network_name, subnet_name): - Show = import_aaz_by_profile("network.vnet.subnet").Show - subnet = Show(cli_ctx=cmd.cli_ctx)(command_args={ - "name": subnet_name, - "resource_group": resource_group_name, - "vnet_name": virtual_network_name, - }) - - try: - address_prefix = subnet["addressPrefixes"][0] - except KeyError: - address_prefix = subnet["addressPrefix"] - start_ip = address_prefix.split("/")[0] - - CheckIpAddress = import_aaz_by_profile("network.vnet").CheckIpAddress - return CheckIpAddress(cli_ctx=cmd.cli_ctx)(command_args={ - "name": virtual_network_name, - "resource_group": resource_group_name, - "ip_address": start_ip, - }).get("availableIPAddresses", []) - - -_VNetPeering = import_aaz_by_profile("network.vnet.peering") - - -class VNetPeeringCreate(_VNetPeering.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.remote_vnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{}", - ) - return args_schema - - -def sync_vnet_peering(cmd, resource_group_name, virtual_network_name, virtual_network_peering_name): - Show = import_aaz_by_profile("network.vnet.peering").Show - try: - peering = Show(cli_ctx=cmd.cli_ctx)(command_args={ - "name": virtual_network_peering_name, - "resource_group": resource_group_name, - "vnet_name": virtual_network_name, - }) - except ResourceNotFoundError: - err_msg = f"Virtual network peering {virtual_network_name} doesn't exist." - raise ResourceNotFoundError(err_msg) - - Create = import_aaz_by_profile("network.vnet.peering").Create - return Create(cli_ctx=cmd.cli_ctx)(command_args={ - "name": virtual_network_peering_name, - "resource_group": resource_group_name, - "vnet_name": virtual_network_name, - "remote_vnet": peering["remoteVirtualNetwork"].pop("id", None), - "allow_vnet_access": peering.pop("allowVirtualNetworkAccess", None), - "allow_gateway_transit": peering.pop("allowGatewayTransit", None), - "allow_forwarded_traffic": peering.pop("allowForwardedTraffic", None), - "use_remote_gateways": peering.pop("useRemoteGateways", None), - }) diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/vnet_gateway.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/vnet_gateway.py deleted file mode 100644 index 09104f87259..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/vnet_gateway.py +++ /dev/null @@ -1,237 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from azure.cli.core.aaz import AAZListArg, AAZStrArg, AAZResourceIdArg, AAZResourceIdArgFormat, AAZFileArg, \ - AAZFileArgBase64EncodeFormat, has_value -from knack.log import get_logger - -from ._util import import_aaz_by_profile - -logger = get_logger(__name__) - - -_VnetGateway = import_aaz_by_profile("network.vnet_gateway") - - -class VnetGatewayCreate(_VnetGateway.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.public_ip_addresses = AAZListArg( - options=['--public-ip-addresses', '--public-ip-address'], - required=True, - help="Specify a single public IP (name or ID) for an active-standby gateway. Specify two space-separated public IPs for an active-active gateway." - ) - args_schema.public_ip_addresses.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}" - ) - ) - args_schema.vnet = AAZResourceIdArg( - options=['--vnet'], - help="Name or ID of an existing virtual network which has a subnet named 'GatewaySubnet'.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{}" - ) - ) - - args_schema.root_cert_data = AAZFileArg(options=['--root-cert-data'], arg_group="Root Cert Authentication", - help="Base64 contents of the root certificate file or file path.", - fmt=AAZFileArgBase64EncodeFormat()) - args_schema.root_cert_name = AAZStrArg(options=['--root-cert-name'], arg_group="Root Cert Authentication", - help="Root certificate name.") - args_schema.gateway_default_site._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/localNetworkGateways/{}" - ) - args_schema.ip_configurations._registered = False - args_schema.active._registered = False - args_schema.vpn_client_root_certificates._registered = False - args_schema.sku_tier._registered = False - args_schema.enable_bgp._registered = False - - return args_schema - - def pre_operations(self): - args = self.ctx.args - subnet = args.vnet.to_serialized_data() + '/subnets/GatewaySubnet' - args.sku_tier = args.sku - args.active = len(args.public_ip_addresses) == 2 - - args.ip_configurations = [] - if has_value(args.public_ip_addresses): - public_ip_addresses = args.public_ip_addresses.to_serialized_data() - ip_configuration = {} - for i, public_ip in enumerate(public_ip_addresses): - ip_configuration[i] = {'subnet': subnet, 'public_ip_address': public_ip, - 'private_ip_allocation_method': 'Dynamic', - 'name': 'vnetGatewayConfig{}'.format(i)} - args.ip_configurations.append(ip_configuration[i]) - - if has_value(args.asn) or has_value(args.bgp_peering_address) or has_value(args.peer_weight): - args.enable_bgp = True - else: - args.asn = None - args.bgp_peering_address = None - args.peer_weight = None - - if has_value(args.address_prefixes) or has_value(args.client_protocol): - import os - if has_value(args.root_cert_data): - path = os.path.expanduser(args.root_cert_data.to_serialized_data()) - else: - path = None - if has_value(args.root_cert_name): - args.vpn_client_root_certificates = [{'name': args.root_cert_name, 'public_cert_data': path}] - else: - args.vpn_client_root_certificates = [] - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return {'vnetGateway': result} - - -class VnetGatewayUpdate(_VnetGateway.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.public_ip_addresses = AAZListArg( - options=['--public-ip-addresses', '--public-ip-address'], - help="Specify a single public IP (name or ID) for an active-standby gateway. Specify two space-separated public IPs for an active-active gateway." - ) - args_schema.public_ip_addresses.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}" - ), - nullable=True, - ) - args_schema.vnet = AAZResourceIdArg( - options=['--vnet'], - help="Name or ID of an existing virtual network which has a subnet named 'GatewaySubnet'.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{}" - ), - ) - args_schema.root_cert_data = AAZFileArg(options=['--root-cert-data'], arg_group="Root Cert Authentication", - help="Base64 contents of the root certificate file or file path.", - fmt=AAZFileArgBase64EncodeFormat(), nullable=True) - args_schema.root_cert_name = AAZStrArg(options=['--root-cert-name'], arg_group="Root Cert Authentication", - help="Root certificate name.", nullable=True,) - args_schema.gateway_default_site._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/localNetworkGateways/{}" - ) - args_schema.ip_configurations._registered = False - args_schema.active._registered = False - args_schema.vpn_client_root_certificates._registered = False - args_schema.sku_tier._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.root_cert_data): - import os - path = os.path.expanduser(args.root_cert_data.to_serialized_data()) - args.root_cert_data = path - - if has_value(args.sku): - args.sku_tier = args.sku - - def pre_instance_update(self, instance): - args = self.ctx.args - if has_value(args.root_cert_data): - collection = instance.properties.vpn_client_configuration.vpn_client_root_certificates.to_serialized_data() - root_certificate = {'name': args.root_cert_name, 'public_cert_data': args.root_cert_data} - value = args.root_cert_name.to_serialized_data() - match = next((x for x in collection if getattr(x, 'name', None) == value), None) - if match: - collection.remove(match) - collection.append(root_certificate) - args.vpn_client_root_certificates = collection - - subnet_id = '{}/subnets/GatewaySubnet'.format(args.vnet) if has_value(args.vnet) else \ - instance.properties.ip_configurations[0].properties.subnet.id - - if has_value(args.vnet): - if has_value(instance.properties.ip_configurations): - for config in instance.properties.ip_configurations: - config.properties.subnet.id = subnet_id - - if has_value(args.public_ip_addresses): - instance.properties.ip_configurations = [] - public_ip_addresses = args.public_ip_addresses.to_serialized_data() - args.ip_configurations = [] - ip_configuration = {} - for i, public_ip in enumerate(public_ip_addresses): - ip_configuration[i] = {'subnet': subnet_id, 'public_ip_address': {'id': public_ip}, - 'private_ip_allocation_method': 'Dynamic', - 'name': 'vnetGatewayConfig{}'.format(i)} - args.ip_configurations.append(ip_configuration[i]) - - # Update active-active/active-standby status - active = len(args.public_ip_addresses) == 2 - if instance.properties.active_active and not active: - logger.info('Placing gateway in active-standby mode.') - elif not instance.properties.active_active and active: - logger.info('Placing gateway in active-active mode.') - args.active = active - - -_VpnClient = import_aaz_by_profile("network.vnet_gateway.vpn_client") - - -def generate_vpn_client(cmd, resource_group_name, virtual_network_gateway_name, processor_architecture=None, - authentication_method=None, radius_server_auth_certificate=None, client_root_certificates=None, - use_legacy=False): - generate_args = {"name": virtual_network_gateway_name, - "resource_group": resource_group_name, - "processor_architecture": processor_architecture} - if not use_legacy: - generate_args['authentication_method'] = authentication_method - generate_args['radius_server_auth_certificate'] = radius_server_auth_certificate - generate_args['client_root_certificates'] = client_root_certificates - return _VpnClient.GenerateVpnProfile(cli_ctx=cmd.cli_ctx)(command_args=generate_args) - # legacy implementation - return _VpnClient.Generate(cli_ctx=cmd.cli_ctx)(command_args=generate_args) - - -_RevokedCert = import_aaz_by_profile("network.vnet_gateway.revoked_cert") - - -class VnetGatewayRevokedCertCreate(_RevokedCert.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.thumbprint._required = True - - return args_schema - - -_RootCert = import_aaz_by_profile("network.vnet_gateway.root_cert") - - -class VnetGatewayRootCertCreate(_RootCert.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.public_cert_data = AAZFileArg(options=['--public-cert-data'], - help="Base64 contents of the root certificate file or file path.", - required=True, - fmt=AAZFileArgBase64EncodeFormat()) - args_schema.root_cert_data._required = False - args_schema.root_cert_data._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.public_cert_data): - import os - path = os.path.expanduser(args.public_cert_data.to_serialized_data()) - else: - path = None - args.root_cert_data = path diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/vpn_connection.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/vpn_connection.py deleted file mode 100644 index 07c2ee84f82..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2019_03_01_hybrid/operations/vpn_connection.py +++ /dev/null @@ -1,85 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger - -from ._util import import_aaz_by_profile - -logger = get_logger(__name__) - - -_VpnConnection = import_aaz_by_profile("network.vpn_connection") - - -class VpnConnectionUpdate(_VpnConnection.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.ipsec_policies._registered = False - - return args_schema - - -class VpnConnectionDeviceConfigScriptShow(_VpnConnection.ShowDeviceConfigScript): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.device_family._required = True - args_schema.firmware_version._required = True - args_schema.vendor._required = True - - return args_schema - - -_VpnConnIpsecPolicy = import_aaz_by_profile("network.vpn_connection.ipsec_policy") - - -class VpnConnIpsecPolicyAdd(_VpnConnIpsecPolicy.Add): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.ipsec_policy_index._registered = False - return args_schema - - -_VpnConnSharedKey = import_aaz_by_profile("network.vpn_connection.shared_key") - - -class VpnConnSharedKeyUpdate(_VpnConnSharedKey.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.value._required = True - return args_schema - - -def list_vpn_connections(cmd, resource_group_name, virtual_network_gateway_name=None): - if virtual_network_gateway_name: - return _VpnConnection.ListConnection(cli_ctx=cmd.cli_ctx)( - command_args={"resource_group": resource_group_name, - "vnet_gateway": virtual_network_gateway_name}) - return _VpnConnection.List(cli_ctx=cmd.cli_ctx)(command_args={"resource_group": resource_group_name}) - - -def clear_vpn_conn_ipsec_policies(cmd, resource_group_name, connection_name, no_wait=False): - class VpnConnIpsecPoliciesClear(_VpnConnection.Update): - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.properties.ipsec_policies, client_flatten=True) - return result - - def pre_operations(self): - args = self.ctx.args - args.ipsec_policies = None - args.use_policy_based_traffic_selectors = False - - ipsec_policies_args = { - "resource_group": resource_group_name, - "name": connection_name, - "no_wait": no_wait, - } - return VpnConnIpsecPoliciesClear(cli_ctx=cmd.cli_ctx)(command_args=ipsec_policies_args) diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/__init__.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/__init__.py deleted file mode 100644 index 34913fb394d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/_params.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/_params.py deleted file mode 100644 index 749b974106c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/_params.py +++ /dev/null @@ -1,9 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -# pylint: disable=unused-argument, too-many-locals, too-many-branches, too-many-statements -def load_arguments(self, _): - pass diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/commands.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/commands.py deleted file mode 100644 index c6efac7fcad..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/commands.py +++ /dev/null @@ -1,184 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - - -# pylint: disable=too-many-locals, too-many-statements, disable=line-too-long -def load_command_table(self, _): - from .operations import import_aaz_by_profile - - # region LoadBalancers - from .operations.load_balancer import LBFrontendIPCreate, LBFrontendIPUpdate - self.command_table["network lb frontend-ip create"] = LBFrontendIPCreate(loader=self) - self.command_table["network lb frontend-ip update"] = LBFrontendIPUpdate(loader=self) - - from .operations.load_balancer import LBInboundNatRuleCreate, LBInboundNatRuleUpdate - self.command_table["network lb inbound-nat-rule create"] = LBInboundNatRuleCreate(loader=self) - self.command_table["network lb inbound-nat-rule update"] = LBInboundNatRuleUpdate(loader=self) - - from .operations.load_balancer import LBInboundNatPoolCreate, LBInboundNatPoolUpdate - self.command_table["network lb inbound-nat-pool create"] = LBInboundNatPoolCreate(loader=self) - self.command_table["network lb inbound-nat-pool update"] = LBInboundNatPoolUpdate(loader=self) - - from .operations.load_balancer import LBRuleCreate, LBRuleUpdate - self.command_table["network lb rule create"] = LBRuleCreate(loader=self) - self.command_table["network lb rule update"] = LBRuleUpdate(loader=self) - - from .operations.load_balancer import LBOutboundRuleCreate, LBOutboundRuleUpdate - self.command_table["network lb outbound-rule create"] = LBOutboundRuleCreate(loader=self) - self.command_table["network lb outbound-rule update"] = LBOutboundRuleUpdate(loader=self) - - from .operations.load_balancer import LBProbeCreate, LBProbeUpdate - self.command_table["network lb probe create"] = LBProbeCreate(loader=self) - self.command_table["network lb probe update"] = LBProbeUpdate(loader=self) - - # endregion - - # region LocalNetworkGateways - local_gateway = import_aaz_by_profile("network.local_gateway") - - from .._format import transform_local_gateway_table_output - self.command_table['network local-gateway list'] = local_gateway.List( - loader=self, table_transformer=transform_local_gateway_table_output) - - # endregion - - # region NetworkInterfaces - from .._format import transform_effective_nsg, transform_effective_route_table - operations_tmpl = self.get_module_name_by_profile("operations.nic#{}") - nic = import_aaz_by_profile("network.nic") - - from .operations.nic import NICCreate, NICUpdate - self.command_table["network nic create"] = NICCreate(loader=self) - self.command_table["network nic update"] = NICUpdate(loader=self) - self.command_table["network nic list-effective-nsg"] = nic.ListEffectiveNsg(loader=self, table_transformer=transform_effective_nsg) - self.command_table["network nic show-effective-route-table"] = nic.ShowEffectiveRouteTable(loader=self, table_transformer=transform_effective_route_table) - - from .operations.nic import NICIPConfigCreate, NICIPConfigUpdate, NICIPConfigNATAdd, NICIPConfigNATRemove - self.command_table["network nic ip-config create"] = NICIPConfigCreate(loader=self) - self.command_table["network nic ip-config update"] = NICIPConfigUpdate(loader=self) - self.command_table["network nic ip-config inbound-nat-rule add"] = NICIPConfigNATAdd(loader=self) - self.command_table["network nic ip-config inbound-nat-rule remove"] = NICIPConfigNATRemove(loader=self) - - with self.command_group("network nic ip-config address-pool", operations_tmpl=operations_tmpl) as g: - g.custom_command("add", "add_nic_ip_config_address_pool") - g.custom_command("remove", "remove_nic_ip_config_address_pool") - - # endregion - - # region VirtualNetworkGatewayConnections - from .operations.vpn_connection import VpnConnectionUpdate, VpnConnectionDeviceConfigScriptShow - self.command_table['network vpn-connection update'] = VpnConnectionUpdate(loader=self) - self.command_table['network vpn-connection show-device-config-script'] = VpnConnectionDeviceConfigScriptShow( - loader=self) - - from .operations.vpn_connection import VpnConnSharedKeyUpdate - self.command_table['network vpn-connection shared-key update'] = VpnConnSharedKeyUpdate(loader=self) - - from .operations.vpn_connection import VpnConnIpsecPolicyAdd - self.command_table['network vpn-connection ipsec-policy add'] = VpnConnIpsecPolicyAdd(loader=self) - - operations_tmpl = self.get_module_name_by_profile("operations.vpn_connection#{}") - with self.command_group('network vpn-connection', operations_tmpl=operations_tmpl) as g: - g.command('list', 'list_vpn_connections') - g.command('ipsec-policy clear', 'clear_vpn_conn_ipsec_policies', supports_no_wait=True) - - # endregion - - # region VirtualNetworkGateways - from .._format import transform_vnet_gateway_bgp_peer_table, transform_vnet_gateway_routes_table - operations_tmpl = self.get_module_name_by_profile("operations.vnet_gateway#{}") - vnet_gateway = import_aaz_by_profile("network.vnet_gateway") - - self.command_table['network vnet-gateway list-bgp-peer-status'] = vnet_gateway.ListBgpPeerStatus( - loader=self, table_transformer=transform_vnet_gateway_bgp_peer_table) - self.command_table['network vnet-gateway list-advertised-routes'] = vnet_gateway.ListAdvertisedRoutes( - loader=self, table_transformer=transform_vnet_gateway_routes_table) - self.command_table['network vnet-gateway list-learned-routes'] = vnet_gateway.ListLearnedRoutes( - loader=self, table_transformer=transform_vnet_gateway_routes_table) - - self.command_table['network vnet-gateway vpn-client ipsec-policy wait'] = vnet_gateway.Wait(loader=self) - - from .operations.vnet_gateway import VnetGatewayCreate, VnetGatewayUpdate - self.command_table['network vnet-gateway create'] = VnetGatewayCreate(loader=self) - self.command_table['network vnet-gateway update'] = VnetGatewayUpdate(loader=self) - - with self.command_group('network vnet-gateway vpn-client', operations_tmpl=operations_tmpl) as g: - g.command('generate', 'generate_vpn_client') - - from .operations.vnet_gateway import VnetGatewayRevokedCertCreate - self.command_table['network vnet-gateway revoked-cert create'] = VnetGatewayRevokedCertCreate(loader=self) - - from .operations.vnet_gateway import VnetGatewayRootCertCreate - self.command_table['network vnet-gateway root-cert create'] = VnetGatewayRootCertCreate(loader=self) - - from .operations.vnet_gateway import VnetGatewayIpsecPolicyAdd - self.command_table['network vnet-gateway ipsec-policy add'] = VnetGatewayIpsecPolicyAdd(loader=self) - - with self.command_group('network vnet-gateway ipsec-policy', operations_tmpl=operations_tmpl) as g: - g.command('clear', 'clear_vnet_gateway_ipsec_policies', supports_no_wait=True) - - # region VirtualNetwork - from .operations.vnet import VNetCreate, VNetUpdate, VNetSubnetCreate, VNetSubnetUpdate, VNetPeeringCreate - from .._format import transform_vnet_table_output - vnet = import_aaz_by_profile("network.vnet") - operations_tmpl = self.get_module_name_by_profile("operations.vnet#{}") - self.command_table['network vnet create'] = VNetCreate(loader=self) - self.command_table['network vnet update'] = VNetUpdate(loader=self) - self.command_table['network vnet list'] = vnet.List(loader=self, table_transformer=transform_vnet_table_output) - with self.command_group('network vnet', operations_tmpl=operations_tmpl) as g: - g.custom_command("list-available-ips", "list_available_ips", is_preview=True) - - self.command_table['network vnet peering create'] = VNetPeeringCreate(loader=self) - with self.command_group('network vnet peering', operations_tmpl=operations_tmpl) as g: - g.custom_command("sync", "sync_vnet_peering") - - self.command_table['network vnet subnet create'] = VNetSubnetCreate(loader=self) - self.command_table['network vnet subnet update'] = VNetSubnetUpdate(loader=self) - with self.command_group('network vnet subnet', operations_tmpl=operations_tmpl) as g: - g.custom_command("list-available-ips", "subnet_list_available_ips", is_preview=True) - # endregion - - # region NetworkRoot - with self.command_group('network'): - from .operations.locations import UsagesList - from .._format import transform_network_usage_table - self.command_table['network list-usages'] = UsagesList(loader=self, - table_transformer=transform_network_usage_table) - # endregion - - # region PublicIPAddresses - public_ip_show_table_transform = '{Name:name, ResourceGroup:resourceGroup, Location:location, $zone$Address:ipAddress, AddressVersion:publicIpAddressVersion, AllocationMethod:publicIpAllocationMethod, IdleTimeoutInMinutes:idleTimeoutInMinutes, ProvisioningState:provisioningState}' - public_ip_show_table_transform = public_ip_show_table_transform.replace('$zone$', 'Zones: (!zones && \' \') || join(` `, zones), ') - - public_ip = import_aaz_by_profile("network.public_ip") - operations_tmpl = self.get_module_name_by_profile("operations.public_ip#{}") - from .operations.public_ip import PublicIPUpdate, PublicIpPrefixCreate - from .._format import transform_public_ip_create_output - from .._validators import process_public_ip_create_namespace - - with self.command_group('network public-ip', operations_tmpl=operations_tmpl) as g: - g.custom_command("create", "create_public_ip", transform=transform_public_ip_create_output, validator=process_public_ip_create_namespace) - - self.command_table['network public-ip update'] = PublicIPUpdate(loader=self) - self.command_table['network public-ip list'] = public_ip.List(loader=self, table_transformer='[].' + public_ip_show_table_transform) - self.command_table['network public-ip show'] = public_ip.Show(loader=self, table_transformer=public_ip_show_table_transform) - - self.command_table['network public-ip prefix create'] = PublicIpPrefixCreate(loader=self) - # endregion - - # region NetworkSecurityGroups - from .operations.nsg import NSGCreate, NSGRuleCreate, NSGRuleUpdate - from .._format import transform_nsg_rule_table_output - operations_tmpl = self.get_module_name_by_profile("operations.nsg#{}") - nsgRule = import_aaz_by_profile("network.nsg.rule") - self.command_table["network nsg create"] = NSGCreate(loader=self) - - self.command_table["network nsg rule create"] = NSGRuleCreate(loader=self) - self.command_table["network nsg rule update"] = NSGRuleUpdate(loader=self) - - self.command_table["network nsg rule show"] = nsgRule.Show(loader=self, table_transformer=transform_nsg_rule_table_output) - with self.command_group("network nsg rule", operations_tmpl=operations_tmpl) as g: - g.custom_command("list", "list_nsg_rules", table_transformer=lambda x: [transform_nsg_rule_table_output(i) for i in x]) - # endregion diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/__init__.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/__init__.py deleted file mode 100644 index fca9bdf191e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-import -from ._util import import_aaz_by_profile diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/_util.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/_util.py deleted file mode 100644 index 1dba900b2bd..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/_util.py +++ /dev/null @@ -1,9 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -import importlib - - -def import_aaz_by_profile(module_name): - return importlib.import_module(f"azure.cli.command_modules.network.aaz.profile_2020_09_01_hybrid.{module_name}") diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/load_balancer.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/load_balancer.py deleted file mode 100644 index b930b3f4590..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/load_balancer.py +++ /dev/null @@ -1,389 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger -from azure.cli.core.azclierror import ArgumentUsageError -from azure.cli.core.aaz import AAZResourceIdArgFormat, has_value, AAZListArg, AAZResourceIdArg, \ - AAZStrArg, AAZArgEnum -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_LBFrontendIP = import_aaz_by_profile("network.lb.frontend_ip") - - -class LBFrontendIPCreate(_LBFrontendIP.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - arg_group="Properties", - options=['--vnet-name'], - help="The virtual network (VNet) associated with the subnet (Omit if supplying a subnet id)." - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_prefix._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIpPrefixes/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}", - ) - - args_schema.zones.Element.enum = AAZArgEnum({ - "1": "1", - "2": "2", - "3": "3", - }) - args_schema.private_ip_allocation_method._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.subnet) and has_value(args.public_ip_address): - raise ArgumentUsageError( - 'incorrect usage: --subnet NAME --vnet-name NAME | ' - '--subnet ID | --public-ip-address NAME_OR_ID') - - if not has_value(args.public_ip_address): - logger.warning( - "Please note that the default public IP used for LB frontend will be changed from Basic to Standard " - "in the future." - ) - - if has_value(args.private_ip_address): - args.private_ip_allocation_method = 'Static' - else: - args.private_ip_allocation_method = 'Dynamic' - - -class LBFrontendIPUpdate(_LBFrontendIP.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - arg_group="Properties", - options=['--vnet-name'], - help="The virtual network (VNet) associated with the subnet (Omit if supplying a subnet id)." - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_prefix._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIpPrefixes/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}", - ) - - args_schema.zones.Element.enum = AAZArgEnum({ - "1": "1", - "2": "2", - "3": "3", - }) - args_schema.private_ip_allocation_method._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.private_ip_address): - # update private_ip_address - if args.private_ip_address: - args.private_ip_allocation_method = 'Static' - else: - # set private_ip_address as null value - args.private_ip_allocation_method = 'Dynamic' - - def post_instance_update(self, instance): - if not has_value(instance.properties.subnet.id): - instance.properties.subnet = None - if not has_value(instance.properties.public_ip_address.id): - instance.properties.public_ip_address = None - if not has_value(instance.properties.public_ip_prefix.id): - instance.properties.public_ip_prefix = None - - -_LBInboundNatPool = import_aaz_by_profile("network.lb.inbound_nat_pool") - - -class LBInboundNatPoolCreate(_LBInboundNatPool.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - - args_schema.protocol._required = True - args_schema.backend_port._required = True - args_schema.frontend_port_range_start._required = True - args_schema.frontend_port_range_end._required = True - return args_schema - - def pre_instance_create(self): - args = self.ctx.args - if not has_value(args.frontend_ip_name): - instance = self.ctx.vars.instance - frontend_ip_configurations = instance.properties.frontend_ip_configurations - if len(frontend_ip_configurations) == 1: - args.frontend_ip_name = instance.properties.frontend_ip_configurations[0].id - elif len(frontend_ip_configurations) > 1: - raise ArgumentUsageError("Multiple FrontendIpConfigurations found in loadbalancer. Specify --frontend-ip explicitly.") - - -class LBInboundNatPoolUpdate(_LBInboundNatPool.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - - args_schema.protocol._nullable = False - args_schema.backend_port._nullable = False - args_schema.frontend_port_range_start._nullable = False - args_schema.frontend_port_range_end._nullable = False - return args_schema - - def post_instance_update(self, instance): - if not has_value(instance.properties.frontend_ip_configuration.id): - instance.properties.frontend_ip_configuration = None - - -_LBInboundNatRule = import_aaz_by_profile("network.lb.inbound_nat_rule") - - -class LBInboundNatRuleCreate(_LBInboundNatRule.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - - # required for a public load balancer - args_schema.protocol._required = True - args_schema.backend_port._required = True - return args_schema - - def pre_instance_create(self): - args = self.ctx.args - if not has_value(args.frontend_ip_name): - instance = self.ctx.vars.instance - frontend_ip_configurations = instance.properties.frontend_ip_configurations - if len(frontend_ip_configurations) == 1: - args.frontend_ip_name = instance.properties.frontend_ip_configurations[0].id - elif len(frontend_ip_configurations) > 1: - raise ArgumentUsageError("Multiple FrontendIpConfigurations found in loadbalancer. Specify --frontend-ip explicitly.") - - -class LBInboundNatRuleUpdate(_LBInboundNatRule.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - return args_schema - - def post_instance_update(self, instance): - if not has_value(instance.properties.frontend_ip_configuration.id): - instance.properties.frontend_ip_configuration = None - - -_LBRule = import_aaz_by_profile("network.lb.rule") - - -class LBRuleCreate(_LBRule.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - args_schema.probe_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/probes/{}" - ) - args_schema.backend_address_pool._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/backendAddressPools/{}" - ) - - args_schema.protocol._required = True - args_schema.frontend_port._required = True - args_schema.backend_port._required = True - - return args_schema - - def pre_instance_create(self): - args = self.ctx.args - if not has_value(args.frontend_ip_name): - instance = self.ctx.vars.instance - frontend_ip_configurations = instance.properties.frontend_ip_configurations - if len(frontend_ip_configurations) == 1: - args.frontend_ip_name = instance.properties.frontend_ip_configurations[0].id - elif len(frontend_ip_configurations) > 1: - raise ArgumentUsageError( - "Multiple FrontendIpConfigurations found in loadbalancer. Specify --frontend-ip explicitly.") - if not has_value(args.backend_address_pool): - instance = self.ctx.vars.instance - backend_address_pools = instance.properties.backend_address_pools - if len(backend_address_pools) == 1: - args.backend_address_pool = instance.properties.backend_address_pools[0].id - elif len(backend_address_pools) > 1: - raise ArgumentUsageError( - "Multiple BackendAddressPools found in loadbalancer. Specify --backend-pool-name explicitly.") - - -class LBRuleUpdate(_LBRule.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.frontend_ip_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - args_schema.probe_name._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/probes/{}" - ) - - args_schema.backend_address_pool._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/backendAddressPools/{}" - ) - - args_schema.protocol._nullable = False - args_schema.frontend_port._nullable = False - args_schema.backend_port._nullable = False - return args_schema - - def post_instance_update(self, instance): - if not has_value(instance.properties.frontend_ip_configuration.id): - instance.properties.frontend_ip_configuration = None - if not has_value(instance.properties.probe.id): - instance.properties.probe = None - if not has_value(instance.properties.backend_address_pool.id): - instance.properties.backend_address_pool = None - - -_LBOutboundRule = import_aaz_by_profile("network.lb.outbound_rule") - - -class LBOutboundRuleCreate(_LBOutboundRule.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.backend_address_pool._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/backendAddressPools/{}" - ) - args_schema.frontend_ip_configs = AAZListArg( - options=["--frontend-ip-configs"], - arg_group="Properties", - help="The List of frontend IP configuration IDs or names.", - ) - args_schema.frontend_ip_configs.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - ) - - args_schema.protocol._required = True - args_schema.backend_address_pool._required = True - args_schema.frontend_ip_configurations._registered = False - return args_schema - - def pre_operations(self): - from azure.cli.core.aaz.utils import assign_aaz_list_arg - args = self.ctx.args - args.frontend_ip_configurations = assign_aaz_list_arg( - args.frontend_ip_configurations, - args.frontend_ip_configs, - element_transformer=lambda _, id: {"id": id} - ) - - -class LBOutboundRuleUpdate(_LBOutboundRule.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.backend_address_pool._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/backendAddressPools/{}" - ) - args_schema.frontend_ip_configs = AAZListArg( - options=["--frontend-ip-configs"], - arg_group="Properties", - help="The List of frontend IP configuration IDs or names.", - ) - args_schema.frontend_ip_configs.Element = AAZResourceIdArg( - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/loadBalancers/{lb_name}/frontendIPConfigurations/{}" - ) - ) - - args_schema.protocol._nullable = False - args_schema.backend_address_pool._nullable = False - args_schema.frontend_ip_configurations._registered = False - return args_schema - - def pre_operations(self): - from azure.cli.core.aaz.utils import assign_aaz_list_arg - args = self.ctx.args - args.frontend_ip_configurations = assign_aaz_list_arg( - args.frontend_ip_configurations, - args.frontend_ip_configs, - element_transformer=lambda _, id: {"id": id} - ) - - -_LBProbe = import_aaz_by_profile("network.lb.probe") - - -class LBProbeCreate(_LBProbe.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.port._required = True - args_schema.protocol._required = True - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.request_path) and args.request_path == "": - args.request_path = None - - -class LBProbeUpdate(_LBProbe.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - - args_schema.port._nullable = False - args_schema.protocol._nullable = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.request_path) and args.request_path == "": - args.request_path = None diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/locations.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/locations.py deleted file mode 100644 index 4167fb38678..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/locations.py +++ /dev/null @@ -1,22 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from ._util import import_aaz_by_profile - - -_NetWork = import_aaz_by_profile("network") - - -class UsagesList(_NetWork.ListUsages): - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) - next_link = self.deserialize_output(self.ctx.vars.instance.next_link) - result = list(result) - for item in result: - item['currentValue'] = str(item['currentValue']) - item['limit'] = str(item['limit']) - item['localName'] = item['name']['localizedValue'] - return result, next_link -# endregion diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/nic.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/nic.py deleted file mode 100644 index 226bd8ddf73..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/nic.py +++ /dev/null @@ -1,528 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods, unused-argument -from azure.cli.core.aaz import AAZResourceIdArgFormat, has_value, AAZListArg, AAZResourceIdArg, \ - AAZStrArg -from azure.cli.core.aaz.utils import assign_aaz_list_arg -from knack.log import get_logger - -from ._util import import_aaz_by_profile - -logger = get_logger(__name__) - - -_NIC = import_aaz_by_profile("network.nic") - - -class NICCreate(_NIC.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - arg_group="IP Configuration", - help="Name of the virtual network.", - ) - args_schema.subnet = AAZResourceIdArg( - options=["--subnet"], - arg_group="IP Configuration", - help="Name or ID of an existing subnet. If name specified, please also specify `--vnet-name`; " - "If you want to use an existing subnet in other resource group, " - "please provide the ID instead of the name of the subnet.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/virtualNetworks/{vnet_name}/subnets/{}", - ), - ) - args_schema.application_security_groups = AAZListArg( - options=["--application-security-groups", "--asgs"], - arg_group="IP Configuration", - help="Space-separated list of application security groups.", - ) - args_schema.application_security_groups.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - args_schema.private_ip_address = AAZStrArg( - options=["--private-ip-address"], - arg_group="IP Configuration", - help="Static private IP address to use.", - ) - args_schema.private_ip_address_version = AAZStrArg( - options=["--private-ip-address-version"], - arg_group="IP Configuration", - help="Version of private IP address to use.", - enum=["IPv4", "IPv6"], - default="IPv4", - ) - args_schema.public_ip_address = AAZResourceIdArg( - options=["--public-ip-address"], - arg_group="IP Configuration", - help="Name or ID of an existing public IP address.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/" - "publicIPAddresses/{}" - ), - ) - args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - arg_group="Application Gateway", - help="Name of the application gateway." - ) - args_schema.app_gateway_address_pools = AAZListArg( - options=["--app-gateway-address-pools", "--ag-address-pools"], - arg_group="Application Gateway", - help="Space-separated list of names or IDs of application gateway backend address pools to " - "associate with the NIC. If names are used, `--gateway-name` must be specified.", - ) - args_schema.app_gateway_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationGateways/{gateway_name}/backendAddressPools/{}", - ), - ) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - arg_group="Load Balancer", - help="Name of the load balancer", - ) - args_schema.lb_address_pools = AAZListArg( - options=["--lb-address-pools"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer address pools to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/backendAddressPools/{}", - ), - ) - args_schema.lb_inbound_nat_rules = AAZListArg( - options=["--lb-inbound-nat-rules"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer inbound NAT rules to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_inbound_nat_rules.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ), - ) - args_schema.network_security_group = AAZResourceIdArg( - options=["--network-security-group"], - help="Name or ID of an existing network security group", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ), - ) - args_schema.ip_configurations._registered = False - args_schema.nsg._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.network_security_group): - args.nsg.id = args.network_security_group - ip_configuration = { - "name": "ipconfig1", - "private_ip_address": args.private_ip_address, - "private_ip_address_version": args.private_ip_address_version, # when address doesn't exist, version should be ipv4 (default) - "private_ip_allocation_method": "Static" if has_value(args.private_ip_address) else "Dynamic", - "subnet": {"id": args.subnet} if has_value(args.subnet) else None, - "public_ip_address": {"id": args.public_ip_address} if has_value(args.public_ip_address) else None, - "application_security_groups": [{"id": x} for x in args.application_security_groups] if has_value(args.application_security_groups) else None, - "application_gateway_backend_address_pools": [{"id": x} for x in args.app_gateway_address_pools] if has_value(args.app_gateway_address_pools) else None, - "load_balancer_backend_address_pools": [{"id": x} for x in args.lb_address_pools] if has_value(args.lb_address_pools) else None, - "load_balancer_inbound_nat_rules": [{"id": x} for x in args.lb_inbound_nat_rules] if has_value(args.lb_inbound_nat_rules) else None, - } - args.ip_configurations = [ip_configuration] - - def _output(self, *args, **kwargs): - result = super()._output(*args, **kwargs) - return {"NewNIC": result} - - -class NICUpdate(_NIC.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.network_security_group = AAZResourceIdArg( - options=["--network-security-group"], - help="Name or ID of an existing network security group", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ), - nullable=True, - ) - args_schema.nsg._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.network_security_group): - args.nsg.id = args.network_security_group - if has_value(args.internal_dns_name) and args.internal_dns_name == "": - args.internal_dns_name = None - - def post_instance_update(self, instance): - if not has_value(instance.properties.network_security_group.id): - instance.properties.network_security_group = None - - -_NICIPConfig = import_aaz_by_profile("network.nic.ip_config") - - -class NICIPConfigCreate(_NICIPConfig.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - arg_group="IP Configuration", - help="Name of the virtual network.", - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/" - "publicIPAddresses/{}" - ) - args_schema.application_security_groups = AAZListArg( - options=["--application-security-groups", "--asgs"], - arg_group="IP Configuration", - help="Space-separated list of application security groups.", - ) - args_schema.application_security_groups.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - arg_group="Application Gateway", - help="Name of the application gateway." - ) - args_schema.app_gateway_address_pools = AAZListArg( - options=["--app-gateway-address-pools", "--ag-address-pools"], - arg_group="Application Gateway", - help="Space-separated list of names or IDs of application gateway backend address pools to " - "associate with the NIC. If names are used, `--gateway-name` must be specified.", - ) - args_schema.app_gateway_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationGateways/{gateway_name}/backendAddressPools/{}", - ), - ) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - arg_group="Load Balancer", - help="Name of the load balancer", - ) - args_schema.lb_address_pools = AAZListArg( - options=["--lb-address-pools"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer address pools to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/backendAddressPools/{}", - ), - ) - args_schema.lb_inbound_nat_rules = AAZListArg( - options=["--lb-inbound-nat-rules"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer inbound NAT rules to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - ) - args_schema.lb_inbound_nat_rules.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ), - ) - args_schema.application_gateway_backend_address_pools._registered = False - args_schema.load_balancer_backend_address_pools._registered = False - args_schema.load_balancer_inbound_nat_rules._registered = False - args_schema.private_ip_allocation_method._registered = False - args_schema.asgs_obj._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - args.private_ip_allocation_method = "Static" if has_value(args.private_ip_address) else "Dynamic" - - args.asgs_obj = assign_aaz_list_arg( - args.asgs_obj, - args.application_security_groups, - element_transformer=lambda _, asg_id: {"id": asg_id} - ) - args.application_gateway_backend_address_pools = assign_aaz_list_arg( - args.application_gateway_backend_address_pools, - args.app_gateway_address_pools, - element_transformer=lambda _, pool_id: {"id": pool_id} - ) - args.load_balancer_backend_address_pools = assign_aaz_list_arg( - args.load_balancer_backend_address_pools, - args.lb_address_pools, - element_transformer=lambda _, pool_id: {"id": pool_id} - ) - args.load_balancer_inbound_nat_rules = assign_aaz_list_arg( - args.load_balancer_inbound_nat_rules, - args.lb_inbound_nat_rules, - element_transformer=lambda _, rule_id: {"id": rule_id} - ) - - def pre_instance_create(self): - args = self.ctx.args - instance = self.ctx.vars.instance - if args.private_ip_address_version.to_serialized_data().lower() == "ipv4" and not has_value(args.subnet): - primary = next(x for x in instance.properties.ip_configurations if x.properties.primary) - args.subnet = primary.properties.subnet.id - if args.make_primary.to_serialized_data(): - for config in instance.properties.ip_configurations: - config.properties.primary = False - - -class NICIPConfigUpdate(_NICIPConfig.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vnet_name = AAZStrArg( - options=["--vnet-name"], - arg_group="IP Configuration", - help="Name of the virtual network.", - nullable=True, - ) - args_schema.subnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/virtualNetworks/{vnet_name}/subnets/{}", - ) - args_schema.public_ip_address._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/" - "publicIPAddresses/{}" - ) - args_schema.application_security_groups = AAZListArg( - options=["--application-security-groups", "--asgs"], - arg_group="IP Configuration", - help="Space-separated list of application security groups.", - nullable=True, - ) - args_schema.application_security_groups.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - nullable=True, - ) - args_schema.gateway_name = AAZStrArg( - options=["--gateway-name"], - arg_group="Application Gateway", - help="Name of the application gateway.", - nullable=True, - ) - args_schema.app_gateway_address_pools = AAZListArg( - options=["--app-gateway-address-pools", "--ag-address-pools"], - arg_group="Application Gateway", - help="Space-separated list of names or IDs of application gateway backend address pools to " - "associate with the NIC. If names are used, `--gateway-name` must be specified.", - nullable=True, - ) - args_schema.app_gateway_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationGateways/{gateway_name}/backendAddressPools/{}", - ), - nullable=True, - ) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - arg_group="Load Balancer", - help="Name of the load balancer", - nullable=True, - ) - args_schema.lb_address_pools = AAZListArg( - options=["--lb-address-pools"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer address pools to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - nullable=True, - ) - args_schema.lb_address_pools.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/backendAddressPools/{}", - ), - nullable=True, - ) - args_schema.lb_inbound_nat_rules = AAZListArg( - options=["--lb-inbound-nat-rules"], - arg_group="Load Balancer", - help="Space-separated list of names or IDs of load balancer inbound NAT rules to associate with the NIC. " - "If names are used, `--lb-name` must be specified.", - nullable=True, - ) - args_schema.lb_inbound_nat_rules.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ), - nullable=True, - ) - args_schema.application_gateway_backend_address_pools._registered = False - args_schema.load_balancer_backend_address_pools._registered = False - args_schema.load_balancer_inbound_nat_rules._registered = False - args_schema.private_ip_allocation_method._registered = False - args_schema.asgs_obj._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.private_ip_address): - if args.private_ip_address is None or args.private_ip_address == "": - # switch private IP address allocation to dynamic if empty string is used - args.private_ip_address = None - args.private_ip_allocation_method = "Dynamic" - args.private_ip_address_version = "IPv4" - else: - # if specific address provided, allocation is static - args.private_ip_allocation_method = "Static" - - def pre_instance_update(self, instance): - args = self.ctx.args - instance = self.ctx.vars.instance - args.asgs_obj = assign_aaz_list_arg( - args.asgs_obj, - args.application_security_groups, - element_transformer=lambda _, asg_id: {"id": asg_id} - ) - args.application_gateway_backend_address_pools = assign_aaz_list_arg( - args.application_gateway_backend_address_pools, - args.app_gateway_address_pools, - element_transformer=lambda _, pool_id: {"id": pool_id} - ) - args.load_balancer_backend_address_pools = assign_aaz_list_arg( - args.load_balancer_backend_address_pools, - args.lb_address_pools, - element_transformer=lambda _, pool_id: {"id": pool_id} - ) - args.load_balancer_inbound_nat_rules = assign_aaz_list_arg( - args.load_balancer_inbound_nat_rules, - args.lb_inbound_nat_rules, - element_transformer=lambda _, rule_id: {"id": rule_id} - ) - # all ip configurations must belong to the same asgs - is_primary = args.make_primary.to_serialized_data() - for config in instance.properties.ip_configurations: - if is_primary: - config.properties.primary = False - config.properties.application_security_groups = args.asgs_obj - - def post_instance_update(self, instance): - if not has_value(instance.properties.subnet.id): - instance.properties.subnet = None - if not has_value(instance.properties.public_ip_address.id): - instance.properties.public_ip_address = None - - -_LBPool = import_aaz_by_profile("network.nic.ip_config.lb_pool") - -_AGPool = import_aaz_by_profile("network.nic.ip_config.ag_pool") - - -def add_nic_ip_config_address_pool(cmd, resource_group_name, network_interface_name, ip_config_name, - backend_address_pool, load_balancer_name=None, application_gateway_name=None): - - class LBPoolAdd(_LBPool.Add): - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result["ipConfigurations"][0] - - class AGPoolAdd(_AGPool.Add): - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result["ipConfigurations"][0] - - arguments = { - "ip_config_name": ip_config_name, - "nic_name": network_interface_name, - "resource_group": resource_group_name, - "pool_id": backend_address_pool - } - if load_balancer_name: - return LBPoolAdd(cli_ctx=cmd.cli_ctx)(command_args=arguments) - if application_gateway_name: - return AGPoolAdd(cli_ctx=cmd.cli_ctx)(command_args=arguments) - - -def remove_nic_ip_config_address_pool(cmd, resource_group_name, network_interface_name, ip_config_name, - backend_address_pool, load_balancer_name=None, application_gateway_name=None): - LBPoolRemove = _LBPool.Remove - AGPoolRemove = _AGPool.Remove - arguments = { - "ip_config_name": ip_config_name, - "nic_name": network_interface_name, - "resource_group": resource_group_name, - "pool_id": backend_address_pool - } - if load_balancer_name: - return LBPoolRemove(cli_ctx=cmd.cli_ctx)(command_args=arguments) - if application_gateway_name: - return AGPoolRemove(cli_ctx=cmd.cli_ctx)(command_args=arguments) - - -_NICIPConfigNAT = import_aaz_by_profile("network.nic.ip_config.inbound_nat_rule") - - -class NICIPConfigNATAdd(_NICIPConfigNAT.Add): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="Name of the load balancer", - ) - args_schema.inbound_nat_rule._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ) - return args_schema - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result["ipConfigurations"][0] - - -class NICIPConfigNATRemove(_NICIPConfigNAT.Remove): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.lb_name = AAZStrArg( - options=["--lb-name"], - help="Name of the load balancer", - ) - args_schema.inbound_nat_rule._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/loadBalancers/{lb_name}/inboundNatRules/{}", - ) - return args_schema diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/nsg.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/nsg.py deleted file mode 100644 index 76188d98d46..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/nsg.py +++ /dev/null @@ -1,184 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger - -from azure.cli.core.aaz import has_value -from azure.cli.core.aaz.utils import assign_aaz_list_arg -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_Nsg = import_aaz_by_profile("network.nsg") -_NsgRule = import_aaz_by_profile("network.nsg.rule") - - -class NSGCreate(_Nsg.Create): - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return {"NewNSG": result} - - -def _handle_plural_or_singular(args, plural_name, singular_name): - values = getattr(args, plural_name) - if not has_value(values): - return - - setattr(args, plural_name, values if len(values) > 1 else None) - setattr(args, singular_name, values[0] if len(values) == 1 else None) - - -class NSGRuleCreate(_NsgRule.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZResourceIdArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.priority._required = True - args_schema.destination_asgs = AAZListArg( - options=["--destination-asgs"], - arg_group="Destination", - help="Space-separated list of application security group names or IDs. Limited by backend server, " - "temporarily this argument only supports one application security group name or ID.", - ) - args_schema.destination_asgs.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - args_schema.source_asgs = AAZListArg( - options=["--source-asgs"], - arg_group="Source", - help="Space-separated list of application security group names or IDs. Limited by backend server, " - "temporarily this argument only supports one application security group name or ID.", - ) - args_schema.source_asgs.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - # filter arguments - args_schema.destination_address_prefix._registered = False - args_schema.destination_application_security_groups._registered = False - args_schema.destination_port_range._registered = False - args_schema.source_address_prefix._registered = False - args_schema.source_application_security_groups._registered = False - args_schema.source_port_range._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - _handle_plural_or_singular(args, "destination_address_prefixes", "destination_address_prefix") - _handle_plural_or_singular(args, "destination_port_ranges", "destination_port_range") - _handle_plural_or_singular(args, "source_address_prefixes", "source_address_prefix") - _handle_plural_or_singular(args, "source_port_ranges", "source_port_range") - # handle application security groups - if has_value(args.destination_asgs): - args.destination_application_security_groups = [{"id": asg_id} for asg_id in args.destination_asgs] - if has_value(args.destination_address_prefix): - args.destination_address_prefix = None - if has_value(args.source_asgs): - args.source_application_security_groups = [{"id": asg_id} for asg_id in args.source_asgs] - if has_value(args.source_address_prefix): - args.source_address_prefix = None - - -class NSGRuleUpdate(_NsgRule.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZResourceIdArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.destination_asgs = AAZListArg( - options=["--destination-asgs"], - arg_group="Destination", - help="Space-separated list of application security group names or IDs. Limited by backend server, " - "temporarily this argument only supports one application security group name or ID.", - nullable=True, - ) - args_schema.destination_asgs.Element = AAZResourceIdArg( - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - args_schema.source_asgs = AAZListArg( - options=["--source-asgs"], - arg_group="Source", - help="Space-separated list of application security group names or IDs. Limited by backend server, " - "temporarily this argument only supports one application security group name or ID.", - nullable=True, - ) - args_schema.source_asgs.Element = AAZResourceIdArg( - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/applicationSecurityGroups/{}", - ), - ) - # filter arguments - args_schema.destination_address_prefix._registered = False - args_schema.destination_application_security_groups._registered = False - args_schema.destination_port_range._registered = False - args_schema.source_address_prefix._registered = False - args_schema.source_application_security_groups._registered = False - args_schema.source_port_range._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - # handle application security groups - args.destination_application_security_groups = assign_aaz_list_arg( - args.destination_application_security_groups, - args.destination_asgs, - element_transformer=lambda _, asg_id: {"id": asg_id} - ) - args.source_application_security_groups = assign_aaz_list_arg( - args.source_application_security_groups, - args.source_asgs, - element_transformer=lambda _, asg_id: {"id": asg_id} - ) - - def pre_instance_update(self, instance): - if instance.properties.sourceAddressPrefix: - instance.properties.sourceAddressPrefixes = [instance.properties.sourceAddressPrefix] - instance.properties.sourceAddressPrefix = None - if instance.properties.destinationAddressPrefix: - instance.properties.destinationAddressPrefixes = [instance.properties.destinationAddressPrefix] - instance.properties.destinationAddressPrefix = None - if instance.properties.sourcePortRange: - instance.properties.sourcePortRanges = [instance.properties.sourcePortRange] - instance.properties.sourcePortRange = None - if instance.properties.destinationPortRange: - instance.properties.destinationPortRanges = [instance.properties.destinationPortRange] - instance.properties.destinationPortRange = None - - def post_instance_update(self, instance): - if instance.properties.sourceAddressPrefixes and len(instance.properties.sourceAddressPrefixes) == 1: - instance.properties.sourceAddressPrefix = instance.properties.sourceAddressPrefixes[0] - instance.properties.sourceAddressPrefixes = None - if instance.properties.destinationAddressPrefixes and len(instance.properties.destinationAddressPrefixes) == 1: - instance.properties.destinationAddressPrefix = instance.properties.destinationAddressPrefixes[0] - instance.properties.destinationAddressPrefixes = None - if instance.properties.sourcePortRanges and len(instance.properties.sourcePortRanges) == 1: - instance.properties.sourcePortRange = instance.properties.sourcePortRanges[0] - instance.properties.sourcePortRanges = None - if instance.properties.destinationPortRanges and len(instance.properties.destinationPortRanges) == 1: - instance.properties.destinationPortRange = instance.properties.destinationPortRanges[0] - instance.properties.destinationPortRanges = None - - -def list_nsg_rules(cmd, resource_group_name, network_security_group_name, include_default=False): - Show = import_aaz_by_profile("network.nsg").Show - nsg = Show(cli_ctx=cmd.cli_ctx)(command_args={ - "resource_group": resource_group_name, - "name": network_security_group_name - }) - - rules = nsg["securityRules"] - return rules + nsg["defaultSecurityRules"] if include_default else rules diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/public_ip.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/public_ip.py deleted file mode 100644 index 80a67d4bea6..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/public_ip.py +++ /dev/null @@ -1,109 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_PublicIP = import_aaz_by_profile("network.public_ip") -_PublicIPPrefix = import_aaz_by_profile("network.public_ip.prefix") - - -def create_public_ip(cmd, resource_group_name, public_ip_address_name, location=None, tags=None, - allocation_method=None, dns_name=None, - idle_timeout=4, reverse_fqdn=None, version=None, sku=None, zone=None, ip_tags=None, - public_ip_prefix=None, ip_address=None): - public_ip_args = { - 'name': public_ip_address_name, - "resource_group": resource_group_name, - 'location': location, - 'tags': tags, - 'allocation_method': allocation_method, - 'idle_timeout': idle_timeout, - 'ip_address': ip_address, - 'ip_tags': ip_tags - } - - if public_ip_prefix: - from azure.mgmt.core.tools import parse_resource_id - metadata = parse_resource_id(public_ip_prefix) - resource_group_name = metadata["resource_group"] - public_ip_prefix_name = metadata["resource_name"] - public_ip_args["public_ip_prefix"] = public_ip_prefix - - # reuse prefix information - Show = import_aaz_by_profile("network.public_ip.prefix").Show - pip_obj = Show(cli_ctx=cmd.cli_ctx)(command_args={'resource_group': resource_group_name, 'name': public_ip_prefix_name}) - version = pip_obj['publicIPAddressVersion'] - sku = pip_obj['sku']['name'] - zone = pip_obj['zones'] if 'zones' in pip_obj else None - - if sku is None: - logger.warning( - "Please note that the default public IP used for creation will be changed from Basic to Standard " - "in the future." - ) - - if not allocation_method: - if sku and sku.lower() == 'standard': - public_ip_args['allocation_method'] = 'Static' - else: - public_ip_args['allocation_method'] = 'Dynamic' - - public_ip_args['version'] = version - public_ip_args['zone'] = zone - - if sku: - public_ip_args['sku'] = sku - if not sku: - public_ip_args['sku'] = 'Basic' - - if dns_name or reverse_fqdn: - public_ip_args['dns_name'] = dns_name - public_ip_args['reverse_fqdn'] = reverse_fqdn - - return PublicIPCreate(cli_ctx=cmd.cli_ctx)(command_args=public_ip_args) - - -class PublicIPCreate(_PublicIP.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.public_ip_prefix._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/publicIPPrefixes/{}", - ) - return args_schema - - -class PublicIPUpdate(_PublicIP.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.public_ip_prefix._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/publicIPPrefixes/{}", - ) - return args_schema - - -class PublicIpPrefixCreate(_PublicIPPrefix.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.sku._registered = False - args_schema.length._required = True - - return args_schema - - def pre_operations(self): - args = self.ctx.args - args.sku = {'name': 'Standard'} diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/vnet.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/vnet.py deleted file mode 100644 index c56d074eb88..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/vnet.py +++ /dev/null @@ -1,342 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger - -from azure.cli.core.aaz import has_value -from azure.cli.core.aaz.utils import assign_aaz_list_arg -from azure.cli.core.azclierror import ResourceNotFoundError -from ._util import import_aaz_by_profile - - -logger = get_logger(__name__) - - -_VNet = import_aaz_by_profile("network.vnet") - - -class VNetCreate(_VNet.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZStrArg, AAZResourceIdArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - # add subnet arguments - args_schema.subnet_name = AAZStrArg( - options=["--subnet-name"], - arg_group="Subnet", - help="Name of a new subnet to create within the VNet.", - ) - args_schema.subnet_prefixes = AAZListArg( - options=["--subnet-prefixes"], - arg_group="Subnet", - help="Space-separated list of address prefixes in CIDR format for the new subnet. If omitted, " - "automatically reserves a /24 (or as large as available) block within the VNet address space.", - ) - args_schema.subnet_prefixes.Element = AAZStrArg() - args_schema.subnet_nsg = AAZResourceIdArg( - options=["--nsg", "--network-security-group"], - arg_group="Subnet", - help="Name or ID of a network security group (NSG).", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ), - ) - args_schema.ddos_protection_plan._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/ddosProtectionPlans/{}", - ) - # filter arguments - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.subnet_name): - subnet = {"name": args.subnet_name} - if not has_value(args.subnet_prefixes): - # set default value - address, bit_mask = str(args.address_prefixes[0]).split("/") - subnet_mask = 24 if int(bit_mask) < 24 else bit_mask - subnet["address_prefix"] = f"{address}/{subnet_mask}" - elif len(args.subnet_prefixes) == 1: - subnet["address_prefix"] = args.subnet_prefixes[0] - else: - subnet["address_prefixes"] = args.subnet_prefixes - if has_value(args.subnet_nsg): - subnet["network_security_group"] = {"id": args.subnet_nsg} - args.subnets = [subnet] - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return {"newVNet": result} - - -class VNetUpdate(_VNet.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - # handle detach logic - args_schema.ddos_protection_plan._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/ddosProtectionPlans/{}", - ) - return args_schema - - def post_instance_update(self, instance): - if not has_value(instance.properties.ddos_protection_plan.id): - instance.properties.ddos_protection_plan = None - - -def list_available_ips(cmd, resource_group_name, virtual_network_name): - Show = import_aaz_by_profile("network.vnet").Show - vnet = Show(cli_ctx=cmd.cli_ctx)(command_args={ - "name": virtual_network_name, - "resource_group": resource_group_name, - }) - - start_ip = vnet["addressSpace"]["addressPrefixes"][0].split("/")[0] - - CheckIpAddress = import_aaz_by_profile("network.vnet").CheckIpAddress - return CheckIpAddress(cli_ctx=cmd.cli_ctx)(command_args={ - "name": virtual_network_name, - "resource_group": resource_group_name, - "ip_address": start_ip, - }).get("availableIPAddresses", []) - - -_VNetSubNet = import_aaz_by_profile("network.vnet.subnet") - - -def _handle_plural_or_singular(args, plural_name, singular_name): - values = getattr(args, plural_name) - if not has_value(values): - return - - setattr(args, plural_name, values if len(values) > 1 else None) - setattr(args, singular_name, values[0] if len(values) == 1 else None) - - -class VNetSubnetCreate(_VNetSubNet.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZStrArg, AAZResourceIdArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.delegations = AAZListArg( - options=["--delegations"], - help="Space-separated list of services to whom the subnet should be delegated, e.g., Microsoft.Sql/servers." - ) - args_schema.delegations.Element = AAZStrArg() - # add endpoint/policy arguments - args_schema.service_endpoints = AAZListArg( - options=["--service-endpoints"], - help="Space-separated list of services allowed private access to this subnet. " - "Values from: az network vnet list-endpoint-services.", - ) - args_schema.service_endpoints.Element = AAZStrArg() - args_schema.service_endpoint_policy = AAZListArg( - options=["--service-endpoint-policy"], - help="Space-separated list of names or IDs of service endpoint policies to apply.", - ) - args_schema.service_endpoint_policy.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/serviceEndpointPolicies/{}", - ), - ) - args_schema.network_security_group._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ) - args_schema.route_table._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/routeTables/{}", - ) - # filter arguments - args_schema.policies._registered = False - args_schema.endpoints._registered = False - args_schema.delegated_services._registered = False - args_schema.address_prefix._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - _handle_plural_or_singular(args, "address_prefixes", "address_prefix") - - def delegation_trans(index, service_name): - service_name = str(service_name) - # covert name to service name - if "/" not in service_name and len(service_name.split(".")) == 3: - _, service, resource_type = service_name.split(".") - service_name = f"Microsoft.{service}/{resource_type}" - return { - "name": str(index), - "service_name": service_name, - } - - args.delegated_services = assign_aaz_list_arg( - args.delegated_services, - args.delegations, - element_transformer=delegation_trans - ) - args.endpoints = assign_aaz_list_arg( - args.endpoints, - args.service_endpoints, - element_transformer=lambda _, service_name: {"service": service_name} - ) - args.policies = assign_aaz_list_arg( - args.policies, - args.service_endpoint_policy, - element_transformer=lambda _, policy_id: {"id": policy_id} - ) - - -class VNetSubnetUpdate(_VNetSubNet.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZListArg, AAZStrArg, AAZResourceIdArg, AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.delegations = AAZListArg( - options=["--delegations"], - help="Space-separated list of services to whom the subnet should be delegated, e.g., Microsoft.Sql/servers.", - nullable=True, - ) - args_schema.delegations.Element = AAZStrArg( - nullable=True, - ) - # add endpoint/policy arguments - args_schema.service_endpoints = AAZListArg( - options=["--service-endpoints"], - help="Space-separated list of services allowed private access to this subnet. " - "Values from: az network vnet list-endpoint-services.", - nullable=True, - ) - args_schema.service_endpoints.Element = AAZStrArg( - nullable=True, - ) - args_schema.service_endpoint_policy = AAZListArg( - options=["--service-endpoint-policy"], - help="Space-separated list of names or IDs of service endpoint policies to apply.", - nullable=True, - ) - args_schema.service_endpoint_policy.Element = AAZResourceIdArg( - nullable=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/serviceEndpointPolicies/{}", - ), - ) - # filter arguments - args_schema.address_prefix._registered = False - args_schema.delegated_services._registered = False - args_schema.endpoints._registered = False - args_schema.policies._registered = False - # handle detach logic - args_schema.network_security_group._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/networkSecurityGroups/{}", - ) - args_schema.route_table._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network" - "/routeTables/{}", - ) - return args_schema - - def pre_operations(self): - args = self.ctx.args - _handle_plural_or_singular(args, "address_prefixes", "address_prefix") - - def delegation_trans(index, service_name): - service_name = str(service_name) - # covert name to service name - if "/" not in service_name and len(service_name.split(".")) == 3: - _, service, resource_type = service_name.split(".") - service_name = f"Microsoft.{service}/{resource_type}" - return { - "name": str(index), - "service_name": service_name, - } - - args.delegated_services = assign_aaz_list_arg( - args.delegated_services, - args.delegations, - element_transformer=delegation_trans - ) - args.endpoints = assign_aaz_list_arg( - args.endpoints, - args.service_endpoints, - element_transformer=lambda _, service_name: {"service": service_name} - ) - args.policies = assign_aaz_list_arg( - args.policies, - args.service_endpoint_policy, - element_transformer=lambda _, policy_id: {"id": policy_id} - ) - - def post_instance_update(self, instance): - if not has_value(instance.properties.network_security_group.id): - instance.properties.network_security_group = None - if not has_value(instance.properties.route_table.id): - instance.properties.route_table = None - - -def subnet_list_available_ips(cmd, resource_group_name, virtual_network_name, subnet_name): - Show = import_aaz_by_profile("network.vnet.subnet").Show - subnet = Show(cli_ctx=cmd.cli_ctx)(command_args={ - "name": subnet_name, - "resource_group": resource_group_name, - "vnet_name": virtual_network_name, - }) - - try: - address_prefix = subnet["addressPrefixes"][0] - except KeyError: - address_prefix = subnet["addressPrefix"] - start_ip = address_prefix.split("/")[0] - - CheckIpAddress = import_aaz_by_profile("network.vnet").CheckIpAddress - return CheckIpAddress(cli_ctx=cmd.cli_ctx)(command_args={ - "name": virtual_network_name, - "resource_group": resource_group_name, - "ip_address": start_ip, - }).get("availableIPAddresses", []) - - -_VNetPeering = import_aaz_by_profile("network.vnet.peering") - - -class VNetPeeringCreate(_VNetPeering.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - from azure.cli.core.aaz import AAZResourceIdArgFormat - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.remote_vnet._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{}", - ) - return args_schema - - -def sync_vnet_peering(cmd, resource_group_name, virtual_network_name, virtual_network_peering_name): - Show = import_aaz_by_profile("network.vnet.peering").Show - try: - peering = Show(cli_ctx=cmd.cli_ctx)(command_args={ - "name": virtual_network_peering_name, - "resource_group": resource_group_name, - "vnet_name": virtual_network_name, - }) - except ResourceNotFoundError: - err_msg = f"Virtual network peering {virtual_network_name} doesn't exist." - raise ResourceNotFoundError(err_msg) - - Create = import_aaz_by_profile("network.vnet.peering").Create - return Create(cli_ctx=cmd.cli_ctx)(command_args={ - "name": virtual_network_peering_name, - "resource_group": resource_group_name, - "vnet_name": virtual_network_name, - "remote_vnet": peering["remoteVirtualNetwork"].pop("id", None), - "allow_vnet_access": peering.pop("allowVirtualNetworkAccess", None), - "allow_gateway_transit": peering.pop("allowGatewayTransit", None), - "allow_forwarded_traffic": peering.pop("allowForwardedTraffic", None), - "use_remote_gateways": peering.pop("useRemoteGateways", None), - }) diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/vnet_gateway.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/vnet_gateway.py deleted file mode 100644 index 7dcb482915c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/vnet_gateway.py +++ /dev/null @@ -1,274 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from azure.cli.core.aaz import AAZListArg, AAZStrArg, AAZResourceIdArg, AAZResourceIdArgFormat, AAZFileArg, \ - AAZFileArgBase64EncodeFormat, has_value -from knack.log import get_logger - -from ._util import import_aaz_by_profile - -logger = get_logger(__name__) - - -_VnetGateway = import_aaz_by_profile("network.vnet_gateway") - - -class VnetGatewayCreate(_VnetGateway.Create): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.public_ip_addresses = AAZListArg( - options=['--public-ip-addresses', '--public-ip-address'], - required=True, - help="Specify a single public IP (name or ID) for an active-standby gateway. Specify two space-separated public IPs for an active-active gateway." - ) - args_schema.public_ip_addresses.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}" - ) - ) - args_schema.vnet = AAZResourceIdArg( - options=['--vnet'], - help="Name or ID of an existing virtual network which has a subnet named 'GatewaySubnet'.", - required=True, - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{}" - ) - ) - - args_schema.root_cert_data = AAZFileArg(options=['--root-cert-data'], arg_group="Root Cert Authentication", - help="Base64 contents of the root certificate file or file path.", - fmt=AAZFileArgBase64EncodeFormat()) - args_schema.root_cert_name = AAZStrArg(options=['--root-cert-name'], arg_group="Root Cert Authentication", - help="Root certificate name.") - args_schema.gateway_default_site._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/localNetworkGateways/{}" - ) - args_schema.ip_configurations._registered = False - args_schema.active._registered = False - args_schema.vpn_client_root_certificates._registered = False - args_schema.sku_tier._registered = False - args_schema.enable_bgp._registered = False - - return args_schema - - def pre_operations(self): - args = self.ctx.args - subnet = args.vnet.to_serialized_data() + '/subnets/GatewaySubnet' - args.sku_tier = args.sku - args.active = len(args.public_ip_addresses) == 2 - - args.ip_configurations = [] - if has_value(args.public_ip_addresses): - public_ip_addresses = args.public_ip_addresses.to_serialized_data() - ip_configuration = {} - for i, public_ip in enumerate(public_ip_addresses): - ip_configuration[i] = {'subnet': subnet, 'public_ip_address': public_ip, - 'private_ip_allocation_method': 'Dynamic', - 'name': 'vnetGatewayConfig{}'.format(i)} - args.ip_configurations.append(ip_configuration[i]) - - if has_value(args.asn) or has_value(args.bgp_peering_address) or has_value(args.peer_weight): - args.enable_bgp = True - else: - args.asn = None - args.bgp_peering_address = None - args.peer_weight = None - - if has_value(args.address_prefixes) or has_value(args.client_protocol): - import os - if has_value(args.root_cert_data): - path = os.path.expanduser(args.root_cert_data.to_serialized_data()) - else: - path = None - if has_value(args.root_cert_name): - args.vpn_client_root_certificates = [{'name': args.root_cert_name, 'public_cert_data': path}] - else: - args.vpn_client_root_certificates = [] - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return {'vnetGateway': result} - - -class VnetGatewayUpdate(_VnetGateway.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.public_ip_addresses = AAZListArg( - options=['--public-ip-addresses', '--public-ip-address'], - help="Specify a single public IP (name or ID) for an active-standby gateway. Specify two space-separated public IPs for an active-active gateway." - ) - args_schema.public_ip_addresses.Element = AAZResourceIdArg( - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/publicIPAddresses/{}" - ), - nullable=True, - ) - args_schema.vnet = AAZResourceIdArg( - options=['--vnet'], - help="Name or ID of an existing virtual network which has a subnet named 'GatewaySubnet'.", - fmt=AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/virtualNetworks/{}" - ), - ) - args_schema.root_cert_data = AAZFileArg(options=['--root-cert-data'], arg_group="Root Cert Authentication", - help="Base64 contents of the root certificate file or file path.", - fmt=AAZFileArgBase64EncodeFormat(), nullable=True) - args_schema.root_cert_name = AAZStrArg(options=['--root-cert-name'], arg_group="Root Cert Authentication", - help="Root certificate name.", nullable=True,) - args_schema.gateway_default_site._fmt = AAZResourceIdArgFormat( - template="/subscriptions/{subscription}/resourceGroups/{resource_group}/providers/Microsoft.Network/localNetworkGateways/{}" - ) - args_schema.ip_configurations._registered = False - args_schema.active._registered = False - args_schema.vpn_client_root_certificates._registered = False - args_schema.sku_tier._registered = False - args_schema.vpn_client_ipsec_policies._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.root_cert_data): - import os - path = os.path.expanduser(args.root_cert_data.to_serialized_data()) - args.root_cert_data = path - - if has_value(args.sku): - args.sku_tier = args.sku - - def pre_instance_update(self, instance): - args = self.ctx.args - if has_value(args.root_cert_data): - collection = instance.properties.vpn_client_configuration.vpn_client_root_certificates.to_serialized_data() - root_certificate = {'name': args.root_cert_name, 'public_cert_data': args.root_cert_data} - value = args.root_cert_name.to_serialized_data() - match = next((x for x in collection if getattr(x, 'name', None) == value), None) - if match: - collection.remove(match) - collection.append(root_certificate) - args.vpn_client_root_certificates = collection - - subnet_id = '{}/subnets/GatewaySubnet'.format(args.vnet) if has_value(args.vnet) else \ - instance.properties.ip_configurations[0].properties.subnet.id - - if has_value(args.vnet): - if has_value(instance.properties.ip_configurations): - for config in instance.properties.ip_configurations: - config.properties.subnet.id = subnet_id - - if has_value(args.public_ip_addresses): - instance.properties.ip_configurations = [] - public_ip_addresses = args.public_ip_addresses.to_serialized_data() - args.ip_configurations = [] - ip_configuration = {} - for i, public_ip in enumerate(public_ip_addresses): - ip_configuration[i] = {'subnet': subnet_id, 'public_ip_address': {'id': public_ip}, - 'private_ip_allocation_method': 'Dynamic', - 'name': 'vnetGatewayConfig{}'.format(i)} - args.ip_configurations.append(ip_configuration[i]) - - # Update active-active/active-standby status - active = len(args.public_ip_addresses) == 2 - if instance.properties.active_active and not active: - logger.info('Placing gateway in active-standby mode.') - elif not instance.properties.active_active and active: - logger.info('Placing gateway in active-active mode.') - args.active = active - - -_VpnClient = import_aaz_by_profile("network.vnet_gateway.vpn_client") - - -def generate_vpn_client(cmd, resource_group_name, virtual_network_gateway_name, processor_architecture=None, - authentication_method=None, radius_server_auth_certificate=None, client_root_certificates=None, - use_legacy=False): - generate_args = {"name": virtual_network_gateway_name, - "resource_group": resource_group_name, - "processor_architecture": processor_architecture} - if not use_legacy: - generate_args['authentication_method'] = authentication_method - generate_args['radius_server_auth_certificate'] = radius_server_auth_certificate - generate_args['client_root_certificates'] = client_root_certificates - return _VpnClient.GenerateVpnProfile(cli_ctx=cmd.cli_ctx)(command_args=generate_args) - # legacy implementation - return _VpnClient.Generate(cli_ctx=cmd.cli_ctx)(command_args=generate_args) - - -_RevokedCert = import_aaz_by_profile("network.vnet_gateway.revoked_cert") - - -class VnetGatewayRevokedCertCreate(_RevokedCert.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.thumbprint._required = True - - return args_schema - - -_RootCert = import_aaz_by_profile("network.vnet_gateway.root_cert") - - -class VnetGatewayRootCertCreate(_RootCert.Create): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.public_cert_data = AAZFileArg(options=['--public-cert-data'], - help="Base64 contents of the root certificate file or file path.", - required=True, - fmt=AAZFileArgBase64EncodeFormat()) - args_schema.root_cert_data._required = False - args_schema.root_cert_data._registered = False - return args_schema - - def pre_operations(self): - args = self.ctx.args - if has_value(args.public_cert_data): - import os - path = os.path.expanduser(args.public_cert_data.to_serialized_data()) - else: - path = None - args.root_cert_data = path - - -_IpsecPolicy = import_aaz_by_profile("network.vnet_gateway.ipsec_policy") - - -class VnetGatewayIpsecPolicyAdd(_IpsecPolicy.Add): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.vpn_client_ipsec_policy_index._registered = False - - return args_schema - - -def clear_vnet_gateway_ipsec_policies(cmd, resource_group_name, gateway_name, no_wait=False): - - class VnetGatewayIpsecPoliciesClear(_VnetGateway.Update): - - def _output(self, *args, **kwargs): - result = self.deserialize_output( - self.ctx.vars.instance.properties.vpn_client_configuration.vpn_client_ipsec_policies, - client_flatten=True - ) - return result - - def pre_instance_update(self, instance): - instance.properties.vpn_client_configuration.vpn_client_ipsec_policies = None - - ipsec_policies_args = { - "resource_group": resource_group_name, - "name": gateway_name, - "no_wait": no_wait - } - - return VnetGatewayIpsecPoliciesClear(cli_ctx=cmd.cli_ctx)(command_args=ipsec_policies_args) diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/vpn_connection.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/vpn_connection.py deleted file mode 100644 index 07c2ee84f82..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/profile_2020_09_01_hybrid/operations/vpn_connection.py +++ /dev/null @@ -1,85 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# pylint: disable=unused-argument, no-self-use, line-too-long, protected-access, too-few-public-methods -from knack.log import get_logger - -from ._util import import_aaz_by_profile - -logger = get_logger(__name__) - - -_VpnConnection = import_aaz_by_profile("network.vpn_connection") - - -class VpnConnectionUpdate(_VpnConnection.Update): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.ipsec_policies._registered = False - - return args_schema - - -class VpnConnectionDeviceConfigScriptShow(_VpnConnection.ShowDeviceConfigScript): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.device_family._required = True - args_schema.firmware_version._required = True - args_schema.vendor._required = True - - return args_schema - - -_VpnConnIpsecPolicy = import_aaz_by_profile("network.vpn_connection.ipsec_policy") - - -class VpnConnIpsecPolicyAdd(_VpnConnIpsecPolicy.Add): - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.ipsec_policy_index._registered = False - return args_schema - - -_VpnConnSharedKey = import_aaz_by_profile("network.vpn_connection.shared_key") - - -class VpnConnSharedKeyUpdate(_VpnConnSharedKey.Update): - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - args_schema = super()._build_arguments_schema(*args, **kwargs) - args_schema.value._required = True - return args_schema - - -def list_vpn_connections(cmd, resource_group_name, virtual_network_gateway_name=None): - if virtual_network_gateway_name: - return _VpnConnection.ListConnection(cli_ctx=cmd.cli_ctx)( - command_args={"resource_group": resource_group_name, - "vnet_gateway": virtual_network_gateway_name}) - return _VpnConnection.List(cli_ctx=cmd.cli_ctx)(command_args={"resource_group": resource_group_name}) - - -def clear_vpn_conn_ipsec_policies(cmd, resource_group_name, connection_name, no_wait=False): - class VpnConnIpsecPoliciesClear(_VpnConnection.Update): - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance.properties.ipsec_policies, client_flatten=True) - return result - - def pre_operations(self): - args = self.ctx.args - args.ipsec_policies = None - args.use_policy_based_traffic_selectors = False - - ipsec_policies_args = { - "resource_group": resource_group_name, - "name": connection_name, - "no_wait": no_wait, - } - return VpnConnIpsecPoliciesClear(cli_ctx=cmd.cli_ctx)(command_args=ipsec_policies_args) diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/zone_file/__init__.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/zone_file/__init__.py deleted file mode 100644 index 67b5b74fd55..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/zone_file/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# The MIT License (MIT) - -# Copyright (c) 2016 Blockstack - -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# pylint: skip-file - -from azure.cli.command_modules.network.azure_stack.zone_file.parse_zone_file import parse_zone_file -from azure.cli.command_modules.network.azure_stack.zone_file.make_zone_file import make_zone_file diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/zone_file/make_zone_file.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/zone_file/make_zone_file.py deleted file mode 100644 index 87ca49e9772..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/zone_file/make_zone_file.py +++ /dev/null @@ -1,102 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# The MIT License (MIT) - -# Copyright (c) 2016 Blockstack - -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# pylint: skip-file -def make_zone_file(json_obj): - """ - Generate the DNS zonefile, given a json-encoded description of the - zone file (@json_zone_file) and the template to fill in (@template) - - json_zone_file = { - "$origin": origin server, - "$ttl": default time-to-live, - "soa": [ soa records ], - "ns": [ ns records ], - "a": [ a records ], - "aaaa": [ aaaa records ] - "caa": [ caa records ] - "cname": [ cname records ] - "mx": [ mx records ] - "ptr": [ ptr records ] - "txt": [ txt records ] - "srv": [ srv records ] - "spf": [ spf records ] - "uri": [ uri records ] - } - """ - import azure.cli.command_modules.network.azure_stack.zone_file.record_processors as record_processors - from io import StringIO - - zone_file = StringIO() - - HEADER = """ -; Exported zone file from Azure DNS\n\ -; Zone name: {zone_name}\n\ -; Resource Group Name: {resource_group}\n\ -; Date and time (UTC): {datetime}\n\n\ -$TTL {ttl}\n\ -$ORIGIN {origin}\n\ - """ - zone_name = json_obj.pop('zone-name') - print(HEADER.format( - zone_name=zone_name, - resource_group=json_obj.pop('resource-group'), - datetime=json_obj.pop('datetime'), - ttl=json_obj.pop('$ttl'), - origin=json_obj.pop('$origin') - ), file=zone_file) - - for record_set_name in json_obj.keys(): - - record_set = json_obj[record_set_name] - if record_set_name.endswith(zone_name): - record_set_name = record_set_name[:-(len(zone_name) + 1)] - if isinstance(record_set, str): - # These are handled above so we can skip them - continue - - first_line = True - record_set_keys = list(record_set.keys()) - if 'soa' in record_set_keys: - record_set_keys.remove('soa') - record_set_keys = ['soa'] + record_set_keys - - for record_type in record_set_keys: - - record = record_set[record_type] - if not isinstance(record, list): - record = [record] - - for entry in record: - method = 'process_{}'.format(record_type.strip('$')) - getattr(record_processors, method)(zone_file, entry, record_set_name, first_line) - first_line = False - - print('', file=zone_file) - - result = zone_file.getvalue() - zone_file.close() - - return result diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/zone_file/parse_zone_file.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/zone_file/parse_zone_file.py deleted file mode 100644 index 378485eb54a..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/zone_file/parse_zone_file.py +++ /dev/null @@ -1,510 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -# The MIT License (MIT) - -# Copyright (c) 2016 Blockstack - -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# pylint: skip-file - -""" -Known limitations: - * only the IN class is supported - * PTR records must have a non-empty name - * currently only supports the following: - '$ORIGIN', '$TTL', 'SOA', 'NS', 'A', 'AAAA', 'CNAME', 'MX', 'PTR', - 'TXT', 'SRV', 'SPF', 'URI', 'CAA', 'NAPTR' -""" - -import copy -import datetime -import time -import argparse -from collections import OrderedDict -import re - -from knack.log import get_logger -from azure.cli.core.azclierror import InvalidArgumentValueError - - -logger = get_logger(__name__) - -semicolon_regex = re.compile(r'(?:"[^"]*")*[^\\](;.*)') -date_regex_dict = { - 'w': {'regex': re.compile(r'(\d*w)'), 'scale': 86400 * 7}, - 'd': {'regex': re.compile(r'(\d*d)'), 'scale': 86400}, - 'h': {'regex': re.compile(r'(\d*h)'), 'scale': 3600}, - 'm': {'regex': re.compile(r'(\d*m)'), 'scale': 60}, - 's': {'regex': re.compile(r'(\d*s)'), 'scale': 1} -} - -_REGEX = { - 'ttl': r'(?P\$ttl)\s+(?P\d+\w*)', - 'origin': r'(?P\$origin)\s+(?P[\w\.-]+)', - 'soa': r'(?P[@\*\w\.-]*)\s+(?:(?P\d+\w*)\s+)?(?:(?Pin)\s+)?(?Psoa)\s+(?P[\w\.-]+)\s+(?P[@\w\.-]+)\s+(?P\d*)\s+(?P\w*)\s+(?P\w*)\s+(?P\w*)\s+(?P\w*)?', - 'a': r'(?P[@\*\w\.-]*)\s+(?:(?P\d+\w*)\s+)?(?:(?Pin)\s+)?(?Pa)\s+(?P[\d\.]+)', - 'ns': r'(?P[@\*\w\.-]*)\s+(?:(?P\d+\w*)\s+)?(?:(?Pin)\s+)?(?Pns)\s+(?P[@\w\.-]+)', - 'aaaa': r'(?P[@\*\w\.-]*)\s+(?:(?P\d+\w*)\s+)?(?:(?Pin)\s+)?(?Paaaa)\s+(?P[\w:]+)', - 'caa': r'(?P[@\*\w\.-]*)\s+(?:(?P\d+\w*)\s+)?(?:(?Pin)\s+)?(?Pcaa)\s+(?P\d+)\s+(?P\w+)\s+(?P.+)', - 'cname': r'(?P[@\*\w\.-]*)\s+(?:(?P\d+\w*)\s+)?(?:(?Pin)\s+)?(?Pcname)\s+(?P[@\w\.-]+)', - 'mx': r'(?P[@\*\w\.-]*)\s+(?:(?P\d+\w*)\s+)?(?:(?Pin)\s+)?(?Pmx)\s+(?P\d+)\s+(?P[@\w\.-]+)', - 'naptr': r'(?P[@\*\w\.-]*)\s+(?:(?P\d+\w*)\s+)?(?:(?Pin)\s+)?(?Pnaptr)\s+(?P\d+)\s+(?P\d+)\s+"(?P[^"]*)"\s+"(?P[^"]*)"\s+"(?P[^"]*)"\s+(?P[\w.-]+)\.?', - 'txt': r'(?P[@\*\w\.-]*)\s+(?:(?P\d+\w*)\s+)?(?:(?Pin)\s+)?(?Ptxt)\s+(?P.+)', - 'ptr': r'(?P[@\*\w\.-]*)\s+(?:(?P\d+\w*)\s+)?(?:(?Pin)\s+)?(?Pptr)\s+(?P[\w\.-]+)', - 'srv': r'(?P[@\*\w\.-]*)\s+(?:(?P\d+\w*)\s+)?(?:(?Pin)\s+)?(?Psrv)\s+(?P\d+)\s+(?P\d+)\s+(?P\d+)\s+(?P[@\w\.-]+)', - 'spf': r'(?P[@\*\w\.-]*)\s+(?:(?P\d+\w*)\s+)?(?:(?Pin)\s+)?(?Pspf)\s+(?P.+)', - 'uri': r'(?P[@\*\w\.-]*)\s+(?:(?P\d+\w*)\s+)?(?:(?Pin)\s+)?(?Puri)\s+(?P\d+)\s+(?P\d+)\s+(?P[\w\.]+)', - 'alias': r'(?P[@\*\w\.-]*)\s+(?:(?P\d+\w*)\s+)?(?:(?Pazure)\s+)?(?Palias)\s+(?Paaaa|a|cname)\s+(?P[a-zA-Z0-9/._-]*)', -} - -_COMPILED_REGEX = {k: re.compile(v, re.IGNORECASE) for k, v in _REGEX.items()} - - -class IncorrectParserException(Exception): - pass - - -def _tokenize_line(line, quote_strings=False, infer_name=True): - """ - Tokenize a line: - * split tokens on whitespace - * treat quoted strings as a single token - """ - ret = [] - escape = False - quote = False - tokbuf = "" - firstchar = True - ll = list(line) - while len(ll) > 0: - c = ll.pop(0) - if c.isspace(): - if firstchar: - # used by the _add_record_names method - tokbuf += '$NAME' if infer_name else ' ' - - if not quote and not escape: - # end of token - if len(tokbuf) > 0: - ret.append(tokbuf) - tokbuf = '' - - elif escape: - # escaped space (can be inside or outside of quote) - tokbuf += '\\' + c - escape = False - - elif quote: - # in quotes - tokbuf += c - - else: - tokbuf = '' - elif c == '\\': - if escape: - # escape of an escape is valid part of the line sequence - tokbuf += '\\\\' - escape = False - else: - escape = True - elif c == '"': - if not escape: - if quote: - # end of quote - if quote_strings: - tokbuf += '"' - ret.append(tokbuf) - tokbuf = '' - quote = False - else: - # beginning of quote - if quote_strings: - tokbuf += '"' - quote = True - else: - # append the escaped quote - tokbuf += '\\"' - escape = False - else: - # normal character - if escape: - # append escape character - tokbuf += '\\' - - tokbuf += c - escape = False - firstchar = False - - if len(tokbuf.strip(' \r\n\t')): - ret.append(tokbuf) - - if len(ret) == 1 and ret[0] == '$NAME': - return [] - else: - return ret - - -def _find_comment_index(line): - """ - Finds the index of a ; denoting a comment. - Ignores escaped semicolons and semicolons inside quotes - """ - escape = False - quote = False - for i, char in enumerate(line): - if char == '\\': - escape = True - continue - elif char == '"': - if escape: - escape = False - continue - else: - quote = not quote - elif char == ';': - if quote: - escape = False - continue - elif escape: - escape = False - continue - else: - # comment denoting semicolon found - return i - else: - escape = False - continue - # no unquoted, unescaped ; found - return -1 - - -def _serialize(tokens): - """ - Serialize tokens: - * quote whitespace-containing tokens - """ - ret = [] - for tok in tokens: - if tok is None: - continue - elif " " in tok: - tok = '"%s"' % tok - - ret.append(tok) - - return " ".join(ret) - - -def _remove_comments(text): - """ - Remove comments from a zonefile - """ - ret = [] - lines = text.split("\n") - for line in lines: - if not line: - continue - - index = _find_comment_index(line) - if index != -1: - line = line[:index] - if line: - ret.append(line) - - return "\n".join(ret) - - -def _flatten(text): - """ - Flatten the text: - * make sure each record is on one line. - * remove parenthesis - * remove Windows line endings - """ - lines = text.split('\n') - SENTINEL = '%%%' - - # tokens: sequence of non-whitespace separated by '' where a newline was - tokens = [] - for line in (x for x in lines if len(x) > 0): - line = line.replace('\t', ' ') - tokens += _tokenize_line(line, quote_strings=True, infer_name=False) - tokens.append(SENTINEL) - - # find (...) and turn it into a single line ("capture" it) - capturing = False - captured = [] - - flattened = [] - while len(tokens) > 0: - tok = tokens.pop(0) - - if tok == '$NAME': - tok = ' ' - - if not capturing and tok == SENTINEL: - # normal end-of-line - if len(captured) > 0: - flattened.append(" ".join(captured)) - captured = [] - continue - - if tok.startswith("("): - # begin grouping - tok = tok.lstrip("(") - capturing = True - - if capturing and tok.endswith(")"): - # end grouping. next end-of-line will turn this sequence into a flat line - tok = tok.rstrip(")") - capturing = False - - if tok != SENTINEL: - captured.append(tok) - - return "\n".join(flattened) - - -def _add_record_names(text): - """ - Go through each line of the text and ensure that - a name is defined. Use previous record name if there is none. - """ - lines = text.split("\n") - ret = [] - previous_record_name = None - - for line in lines: - tokens = _tokenize_line(line) - if not tokens: - continue - - record_name = tokens[0] - if record_name == '$NAME': - tokens = [previous_record_name] + tokens[1:] - elif not record_name.startswith('$'): - previous_record_name = record_name - - ret.append(_serialize(tokens)) - - return "\n".join(ret) - - -def _convert_to_seconds(value): - """ Converts TTL strings into seconds """ - try: - return int(value) - except ValueError: - # parse the BIND format - # (w)eek, (d)ay, (h)our, (m)inute, (s)econd - seconds = 0 - ttl_string = value.lower() - for component in ['w', 'd', 'h', 'm', 's']: - regex = date_regex_dict[component]['regex'] - match = regex.search(ttl_string) - if match: - match_string = match.group(0) - ttl_string = ttl_string.replace(match_string, '') - match_value = int(match_string.strip(component)) - seconds += match_value * date_regex_dict[component]['scale'] - if not ttl_string: - return seconds - # convert the last piece without any units, which must be seconds - try: - seconds += int(ttl_string) - return seconds - except ValueError: - raise InvalidArgumentValueError("Unable to convert value '{}' to seconds.".format(value)) - - -def _expand_with_origin(record, properties, origin): - if not isinstance(properties, list): - properties = [properties] - - for property in properties: - if "@" in record[property]: - record[property] = record[property].replace('@', origin) - elif not record[property].endswith('.'): - record[property] = '{}.{}'.format(record[property], origin) - - -def _post_process_ttl(zone): - for name in zone: - for record_type in zone[name]: - records = zone[name][record_type] - if isinstance(records, list): - ttl = min([x['ttl'] for x in records]) - for record in records: - if record['ttl'] != ttl: - logger.warning('Using lowest TTL {} for the record set. Ignoring value {}' - .format(ttl, record['ttl'])) - record['ttl'] = ttl - - -def _post_process_txt_record(record): - - def line_split(line): - return re.findall(r'"(?:\\.|[^"\\])*"|(?:\\.|[^"\s\\])+', line) - - record_split = line_split(record['txt']) - - # strip quotes - for i, val in enumerate(record_split): - if val.startswith('"') and val.endswith('"'): - record_split[i] = val[1:-1] - - long_text = ''.join(record_split) - original_len = len(long_text) - record['txt'] = [] - while len(long_text) > 255: - record['txt'].append(long_text[:255]) - long_text = long_text[255:] - record['txt'].append(long_text) - final_str = ''.join(record['txt']) - final_len = len(final_str) - assert (original_len == final_len) - - -def _post_process_caa_record(record): - # strip quotes - if record['val'].startswith('"') and record['val'].endswith('"'): - record['val'] = record['val'][1:-1] - - -def _post_check_names(zone): - - # get the origin name that has the SOA record - # ensure the origin is in each record set - origin = None - for name in zone: - for record_type in zone[name]: - if record_type == 'soa': - origin = name - break - if origin: - break - bad_names = [x for x in zone if origin not in x] - if bad_names: - raise InvalidArgumentValueError("Record names '{}' are not part of the domain.".format(bad_names)) - - -def parse_zone_file(text, zone_name, ignore_invalid=False): - """ - Parse a zonefile into a dict - """ - - text = _remove_comments(text) - text = _flatten(text) - text = _add_record_names(text) - - zone_obj = OrderedDict() - record_lines = text.split("\n") - current_origin = zone_name.rstrip('.') + '.' - current_ttl = 3600 - soa_processed = False - - for record_line in record_lines: - parse_match = False - record = None - for record_type, regex in _COMPILED_REGEX.items(): - match = regex.match(record_line) - if not match: - continue - - parse_match = True - record = match.groupdict() - - if not parse_match and not ignore_invalid: - raise InvalidArgumentValueError('Unable to parse: {}'.format(record_line)) - - record_type = record['delim'].lower() - if record_type == '$origin': - origin_value = record['val'] - if not origin_value.endswith('.'): - logger.warning("$ORIGIN '{}' should have terminating dot.".format(origin_value)) - current_origin = origin_value.rstrip('.') + '.' - elif record_type == '$ttl': - current_ttl = _convert_to_seconds(record['val']) - else: - record_name = record['name'] - if '@' in record_name: - record_name = record_name.replace('@', current_origin) - elif not record_name.endswith('.'): - record_name = '{}.{}'.format(record_name, current_origin) - - # special record-specific fix-ups - if record_type == 'ptr': - record['fullname'] = record_name + '.' + current_origin - elif record_type == 'soa': - for key in ['refresh', 'retry', 'expire', 'minimum']: - record[key] = _convert_to_seconds(record[key]) - _expand_with_origin(record, 'email', current_origin) - elif record_type == 'cname': - _expand_with_origin(record, 'alias', current_origin) - elif record_type == 'mx': - _expand_with_origin(record, 'host', current_origin) - elif record_type == 'ns': - _expand_with_origin(record, 'host', current_origin) - elif record_type == 'srv': - _expand_with_origin(record, 'target', current_origin) - elif record_type == 'spf': - record_type = 'txt' - record['ttl'] = _convert_to_seconds(record['ttl'] or current_ttl) - - # handle quotes for CAA and TXT - if record_type == 'caa': - _post_process_caa_record(record) - elif record_type == 'txt': - # handle TXT concatenation and splitting separately - _post_process_txt_record(record) - - if record_name not in zone_obj: - zone_obj[record_name] = OrderedDict() - - if record_type == 'soa': - if soa_processed: - raise InvalidArgumentValueError('Zone file can contain only one SOA record.') - if record_name != current_origin: - raise InvalidArgumentValueError("Zone SOA record must be at the apex '@'.") - zone_obj[record_name][record_type] = record - soa_processed = True - continue - - if not soa_processed: - raise InvalidArgumentValueError('First record in zone file must be SOA.') - - if record_type == 'cname': - if record_type in zone_obj[record_name]: - logger.warning("CNAME record already exists for '{}'. Ignoring '{}'." - .format(record_name, record['alias'])) - continue - zone_obj[record_name][record_type] = record - continue - - # any other record can have multiple entries - if record_type not in zone_obj[record_name]: - zone_obj[record_name][record_type] = [] - zone_obj[record_name][record_type].append(record) - - _post_process_ttl(zone_obj) - _post_check_names(zone_obj) - return zone_obj diff --git a/src/azure-cli/azure/cli/command_modules/network/azure_stack/zone_file/record_processors.py b/src/azure-cli/azure/cli/command_modules/network/azure_stack/zone_file/record_processors.py deleted file mode 100644 index 0c3de6eba9e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/azure_stack/zone_file/record_processors.py +++ /dev/null @@ -1,134 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -# The MIT License (MIT) - -# Copyright (c) 2016 Blockstack - -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# pylint: skip-file - -import copy - - -def process_soa(io, data, name, print_name=False): - """ - Replace {SOA} in template with a set of serialized SOA records - """ - indent = ' ' * len('{} {} IN SOA '.format(name, data['ttl'])) - print('{} {} IN SOA {} {} ('.format(name, data['ttl'], data['mname'], data['rname']), file=io) - for item in ['serial', 'refresh', 'retry', 'expire', 'minimum']: - print('{}{} ; {}'.format(indent, data[item], item), file=io) - print('{})'.format(indent), file=io) - - -def _quote_field(data, field): - """ - Quote a field in a list of DNS records. - Return the new data records. - """ - if data is None: - return None - - # embedded quotes require escaping - but only if not escaped already - # note that semi-colons do not need escaping here since we are putting it - # inside of a quoted string - fieldBuf = "" - escape = False - for c in data[field]: - if c == '"': - fieldBuf += '\\"' - escape = False - elif c == '\\': - if escape: - fieldBuf += '\\\\' - escape = False - else: - escape = True - else: - if escape: - fieldBuf += '\\' - fieldBuf += c - escape = False - - data[field] = '"%s"' % fieldBuf - - return data - - -def process_rr(io, data, record_type, record_keys, name, print_name): - """ Print out single line record entries """ - if data is None: - return - - if isinstance(record_keys, str): - record_keys = [record_keys] - elif not isinstance(record_keys, list): - raise ValueError('record_keys must be a string or list of strings') - - in_or_azure = "IN" - if record_type == 'ALIAS': - in_or_azure = "AZURE" - - name_display = name if print_name else ' ' * len(name) - print('{} {} {} {} '.format(name_display, data['ttl'], in_or_azure, record_type), end='', file=io) - - for i, key in enumerate(record_keys): - print(data[key], end='\n' if i == len(record_keys) - 1 else ' ', file=io) - - -def process_ns(io, data, name, print_name=False): - process_rr(io, data, 'NS', 'host', name, print_name) - - -def process_a(io, data, name, print_name=False): - return process_rr(io, data, 'A', 'ip', name, print_name) - - -def process_aaaa(io, data, name, print_name=False): - return process_rr(io, data, 'AAAA', 'ip', name, print_name) - - -def process_caa(io, data, name, print_name=False): - process_rr(io, _quote_field(data, 'val'), 'CAA', ['flags', 'tag', 'val'], name, print_name) - - -def process_cname(io, data, name, print_name=False): - return process_rr(io, data, 'CNAME', 'alias', name, print_name) - - -def process_mx(io, data, name, print_name=False): - return process_rr(io, data, 'MX', ['preference', 'host'], name, print_name) - - -def process_ptr(io, data, name, print_name=False): - return process_rr(io, data, 'PTR', 'host', name, print_name) - - -def process_txt(io, data, name, print_name=False): - return process_rr(io, _quote_field(data, 'txt'), 'TXT', 'txt', name, print_name) - - -def process_srv(io, data, name, print_name=False): - return process_rr(io, data, 'SRV', ['priority', 'weight', 'port', 'target'], name, print_name) - - -def process_alias(io, data, name, print_name=False): - return process_rr(io, data, 'ALIAS', 'target-resource-id', name, print_name)